62. Appear 和 Disappear
• 除了加载和卸载以外,view controller 也会在特定
的时间出现或者消失
• view controller 只会被创建⼀一次,但是它的 view
通常会显⽰示(释放或者隐藏)多次
• 我们可以在这些⽣生命周期事件发⽣生时做⼀一些⾃自定
义的操作,⽐比如我们可以让 TimeViewController 的
view 每次显⽰示时,可以显⽰示最新时间
- (void)viewWillAppear:(BOOL)animated; // Called when the view is about
to made visible. Default does nothing
- (void)viewDidAppear:(BOOL)animated; // Called when the view has been
fully transitioned onto the screen. Default does nothing
- (void)viewWillDisappear:(BOOL)animated; // Called when the view is
dismissed, covered or otherwise hidden. Default does nothing
- (void)viewDidDisappear:(BOOL)animated; // Called after the view was
dismissed, covered or otherwise hidden. Default does nothing