Ios – Navigation Controllers in tab bar controller

iosiphoneuinavigationcontrolleruitabbarcontroller

What is the logic or view structure of an app with a tab bar, e.g. 3 different tabs. Each tab having a navigation controller inside the tab viewcontroller tabs?

Where are the navigation controllers created and managed?

Best Answer

If you're using NIB files, you can set up the structure of your app right in your main NIB. The structure looks like this:

  • UITabViewController
    • UINavigationViewController
      • TabBarItem
      • UIViewController (set to load from Tab 1 View.nib)
        • NavigationItem (for root view of tab 1's nav controller)
    • UINavigationViewController
      • TabBarItem
      • UIViewController (set to load from Tab 2 View.nib)
        • NavigationItem
    • UINavigationViewController
      • TabBarItem
      • UIViewController (set to load from Tab 3 View.nib)
        • NavigationItem