Allie Allie - 28 days ago 9
Swift Question

Edit button inside UITabBarController and UINavigationController

I just embedded my UINavigationController into a UITabBarController. I can no longer see my view title or edit button. Please see storyboard below. How do I make the edit button visible again?

My Storyboard:
My Storyboard

Answer

Rather than the following organization (which you're currently using):

NavController -> TabBarController -> ViewControllerA
                                  \
                                   -> ViewControllerB

You must do the following:

TabBarController -> NavControllerA -> ViewControllerA
                 \
                  -> NavControllerB -> ViewControllerB

UITabBarControllers should always be the root view. Each child view controller needs its own navigation controller to achieve the navigation bar + tab bar effect you desire. Here is an example of what the structure should look like:

Storyboard laid out with TabBarController at the root.

As for adding navigation items / titles to each view controller once you've done the above, make sure to drag Navigation Items onto each view controller. You can find the Navigation Item in the Object Library at the bottom of the Utilities view:

Navigation Item in the Object Library