ViewController的生命周期

原文地址:http://www.jianshu.com/p/df240103cedf

显示时(push)调用一览表

1.initWithCoder:

2.awakeFromNib

3.willMoveToParentViewController:

4.prefersStatusBarHidden

5.preferredStatusBarUpdateAnimation

6.loadView

7.prepareForSegue:sender:

8.viewDidLoad

9.extendedLayoutIncludesOpaqueBars

10.edgesForExtendedLayout

11.viewWillAppear:

12.extendedLayoutIncludesOpaqueBars

13.edgesForExtendedLayout

14.updateViewConstraints

15.viewWillLayoutSubviews

16.viewDidLayoutSubviews

17.(Animation)

18.viewDidAppear:

19.didMoveToParentViewController:

20.updateViewConstraints

21.viewWillLayoutSubviews

22.viewDidLayoutSubviews

测试Demo地址:https://github.com/StreamStone/ViewControllerLifecircleDemo

你可能感兴趣的:(ViewController的生命周期)