美文网首页iOS小结
viewController方法的调用

viewController方法的调用

作者: SylvaChen | 来源:发表于2019-02-19 17:19 被阅读5次

app 启动后的流程

启动后第一个页面A的方法调用

初始化

1: A_ViewController initWithCoder:

loadView会在页面

2: A_ViewController loadView

3: A_ViewController viewDidLoad

4: A_ViewController loadViewIfNeeded

5: A_ViewController viewWillAppear:

6: A_ViewController viewWillLayoutSubviews

viewDidLayoutSubviews :

When the bounds change for a view controller'��s view, the view adjusts the positions of its subviews and then the system calls this method. However, this method being called does not indicate that the individual layouts of the view'��s subviews have been adjusted. Each subview is responsible for adjusting its own layout.

Your view controller can override this method to make changes after the view lays out its subviews. The default implementation of this method does nothing.

在viewController的view bounds发生变化时,view会调整subviews的位置,调整完成后会调用viewDidLayoutSubviews

7: A_ViewController viewDidLayoutSubviews

8: A_ViewController viewWillLayoutSubviews

9: A_ViewController viewDidLayoutSubviews

10: A_ViewController viewDidAppear:

页面A push with animated 出页面B后

11: B_ViewController initWithCoder:

12: B_ViewController loadView

13: B_ViewController viewDidLoad

14: A_ViewController viewWillDisappear:

15: B_ViewController viewWillAppear:

16: B_ViewController loadViewIfNeeded

17: B_ViewController viewWillLayoutSubviews

18: B_ViewController viewDidLayoutSubviews

19: A_ViewController viewDidDisappear:

20: B_ViewController viewDidAppear:

页面B pop animated 出页面A

21: B_ViewController viewWillDisappear:

22: A_ViewController viewWillAppear:

23: A_ViewController loadViewIfNeeded

24: B_ViewController viewDidDisappear:

25: A_ViewController viewDidAppear:

26: B_ViewController dealloc

相关文章

网友评论

    本文标题:viewController方法的调用

    本文链接:https://www.haomeiwen.com/subject/mlsfyqtx.html