一. A控制器从无到有
A: 0 -> 1
A --- -[ViewController viewDidLoad]
A --- -[ViewController viewWillAppear:]
A --- -[ViewController viewWillLayoutSubviews]
A --- -[ViewController viewDidLayoutSubviews]
A --- -[ViewController viewDidAppear:]
二. A控制器push到B控制器
A: 1 -> 0
B: 0 -> 1
1. B完成加载
B --- -[BViewController viewDidLoad]
2. A将要消失
A --- -[ViewController viewWillDisappear:]
3. B将要显示+显示布局
B --- -[BViewController viewWillAppear:]
B --- -[BViewController viewWillLayoutSubviews]
B --- -[BViewController viewDidLayoutSubviews]
4. A完全消失
A --- -[ViewController viewDidDisappear:]
5. B完全显示
B --- -[BViewController viewDidAppear:]
三. B控制器pop回A控制器
B: 1 -> 0
A: 0 -> 1
1. B将要消失
B --- -[BViewController viewWillDisappear:]
2. A将要显示
A --- -[ViewController viewWillAppear:]
3. B完全消失
B --- -[BViewController viewDidDisappear:]
4. A完全显示
A --- -[ViewController viewDidAppear:]
demo演示地址:https://github.com/Swift-Aramis/ABControllerLife.git