Search code examples
iosxcodeuistoryboarduistoryboardsegueuinavigationitem

Where is UINavigationItem disappearing to when refactoring views to storyboard?


I'm rewriting an Obj-C project using Swift 4 / Xcode 9.2

I have a large storyboard that I am breaking down into multiple storyboards. I did this previously without any issues. If I refactored a few views to their own storyboard then the views took the navigation item with them. now they disappear...

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

[CS [6]

enter image description here My questions are ...

Is this an Xcode bug? or a new feature?

Obviously you can work around this as I have shown in the pictures but is there a way to stop the vanishing from happening?


Solution

  • This is the way it's always been. In your storyboard, if a view controller is not a child of a navigation controller via root view controller or push segues, then by default no navigation bar is shown in the storyboard. You can force it on, though, by going to the Simulated Metrics section of the Attributes Inspector tab and selecting one of the navigation bar options for "Top Bar".