I'm trying to complete my first iOS application.
My storyboard layout is this:
Navigation Controller
'-> View Controller
'->Tab Bar Controller
|->Table View Controller
| '->View Controller
'->Table View Controller
'->View Controller
All of the views are shown with a push (not modal) so need back navigation. Problem is when I go back from the last View to the Table View, viewWillAppear doesn't fire. So I added navigation controllers:
Navigation Controller
'-> View Controller
'->Tab Bar Controller
|->Navigation Controller
| '->Table View Controller
| '->View Controller*
'->Navigation Controller
'->Table View Controller
'->View Controller
This fixes the viewWillAppear problem, but then the tab bar still shows at the bottom and i get an extra navigation bar in the table view and final view (see below - corresponds to * above). Pressing the top "< Back" button takes me back to the very first view (wrong), pressing the second "< Back" button takes me back to the table view (correct)
Questions:
- What am I doing wrong here???
- When should a view have a NavigationController? Is it ok to have one for the whole storyboard or should I have more.
- If I put a navigation controller after a tab bar, the bottom tab bar stays. How do I get rid of it?
- Should I avoid tab bars?
UPDATE:
This is bizarre. If I recreate the story board I can narrow it down to the initial view controller / navigation controller pair. No idea what could be the issue as swapping these out for a fresh pair solves it.