Search code examples
swiftuinavigationcontrollerstoryboard

UINavigationController's children views don't have UINavigationItem to set the title


I have a UINavigationController implemented to have the kind of pop/push functionality. However, on the children views I cannot set the title of the Navigation Bar, but rather only on the first view:

enter image description here

On the "Buzzy" page as seen above, when I select the navigation bar, the utilities tab shows me that it is a UINavigationItem and I can edit its title. However, on one of the children views, such as the one with "Tappable Area", the navigation bar cannot be selected and the title cannot be added.

How do I add the title for children views as well?


Solution

  • Drag a Navigation Item object from the Objects palette (cmd-shift-L) onto the view controller and select it.

    enter image description here

    You should now be able to set the title, add UIBarButtonItems etc.