I have a simple Tab bar navigation app
-------------------
| |
| |
| |
| |
| |
| |
| |
| (o) |
| |
[ Tab 1 ]_[ Tab 2 ]
When Tab 1 is touched, Screen 1 is shown. When Tab 2 is pressed, Screen 2 is shown.
How can I call an action each time a screen is shown (not just on the viewDidLoad event).
Do I have to listen to the touch event on the Tab bar or is there an event in the ViewController I can listen for?
viewDidLoadgets called when the nib is being loaded into memory. When a view is actually appearing on the screen,viewDidAppeargets called.[Edit]
This is the (natural) order of callbacks:
initWithNibName:Bundle: -> awakeFromNib -> loadView -> viewDidLoad -> viewWillAppear -> viewDidAppear[Edit2]
see here for an excellent explanation: https://stackoverflow.com/a/5109277/347353