As views come and go, driven by view controllers and the actions of the user, events arrive that give you the opportunity to respond.
First, there are delegate messages:
In addition, a view controller receives four events that you can override in a subclass (the parameter tells you whether the change is being animated):
If you override any of these methods, you must call
In these four view controller events, the notions “appear” and “disappear” mean exactly what you think they do. View controllers are all about views that can come and go — for example, because a modal view is shown, because a modal view is dismissed, because a tab bar controller is switched to a new view, or because a navigation controller’s stack is pushed or popped. In each of these cases, some ...