Groppe
Groppe

Reputation: 3879

How to properly combine a Tab Bar View and Navigation Bar in iOS

In my iOS application I have a tab bar view with three views. I would like each of those views to have a "navigation" bar at the top. I would like the navigation bar to have a left bar button item which has the same functionality across all three views, and then a right bar button item which is unique to each view. How should I build this?

Upvotes: 10

Views: 4442

Answers (1)

Amy Worrall
Amy Worrall

Reputation: 16337

In each tab, put a UINavigationController. That's a separate one for each tab.

Set the root view controller of each navigation controller to a view controller that manages the content view you want to display.

You can set the left button item of each of the three navigation controllers to the same thing, and set the right button item to something different.

Upvotes: 16

Related Questions