viewController的生命週期

ytmaylover發表於2018-09-05
UIViewController中的view顯示步驟
--------------------------------------------------------------------------------------------------------
進入UIViewController時的情況:
viewDidLoad
viewWillLayoutSubviews
viewDidLayoutSubviews
viewWillAppear
viewWillLayoutSubviews
viewDidLayoutSubviews
viewDidAppear
切換了Controller後的情況(比如你在TabbarController中切換了):
viewWillDisappear
viewDidDisappear
再次切換回來後的情況:
viewWillLayoutSubviews
viewDidLayoutSubviews
viewWillAppear
viewWillLayoutSubviews
viewDidLayoutSubviews
viewDidAppear
退入到後臺後的情況:
無
從後臺進入程式時的情況:
viewWillLayoutSubviews
viewDidLayoutSubviews
複製程式碼

相關文章