Question

I am trying to setup a Model View Controller to have a Navigation Bar just in the storyboard.

I have setup a segue from one view controller to another and marked it as Model.

I have changed the Model VC to have Top Bar : Translucent Navigation Bar.
I call the segue by name with the following:

[self performSegueWithIdentifier:@"testModel" sender:self];

When the model view controller shows up there is no Navigation Bar. Am I missing something that should make this show.

The Model View Controller is not actually in a Navigation Controller stack and shouldn't be as there is no movement other than dismiss from this Model View Controller. I am just trying to use the Navigation Bar to show a title for the model VC.

Was it helpful?

Solution

When you changed your view controller to "Top Bar : Translucent Navigation Bar.", that is under "Simulated Metrics". Changing that value tells Xcode that the view controller will have a navigation bar, it does not actually create a navigation bar. I suggest you either

  1. Embed your view controller in a navigation controller (there is no rule that says you have to push anything from your navigation controller, and you might decide to add features in the future)
  2. Use a toolbar instead of a navigation bar
  3. Just use a label if all you want is a title on your view controller.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top