viewController方法的调用

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:

【viewController方法的调用】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

    推荐阅读