Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 8 Navigation Bar Not Accessible in Second ViewController on Storyboard

I am new to iOS development and have not tried this programmatically yet. I would prefer to get this working in a storyboard.

I'm following this somewhat outdated tutorial from XCode 4.5 in XCode 6.1 to create a series of views connected by one navigation controller. http://youtu.be/rgd6mCuzlEc

Screenshot

Once I create the second view controller, I am unable to double click the navigation bar to change the name and I am unable to add a bar button to it.

I have a Segue going from bar button "Item" from view 1 to 2. Notice in the "View Controller Scene" there is no navigation item. If I add any elements to the view controller they fall under "View" and not under "View Controller", unlike view controller 1 where it falls under "one".

Is this a limitation on XCode? Am I using the wrong Segue (Show)? Is there a hidden setting or customization I'm missing?

I actually have this working for 2 view controllers and failing the 3rd in a separate project but I don't know what I did to do that so I'm pretty sure it's possible I just cannot reproduce..

EDIT: Workaround Instead of the new adaptive SHOW segue, use the deprecated PUSH segue, add the bar button items, then change back to the adaptive SHOW segue.

like image 685
Daniel E Avatar asked Dec 02 '14 06:12

Daniel E


People also ask

How do I add a navigation bar to my storyboard in Swift?

Go to the Storyboard. Select the View Controller and in The Editor menu select Embed in -> Navigation Controller. Next, drag a Bar Button from the Object Library to the left side of the Navigation Bar and name it "Left Item". Repeat this for the right side and name it "Right Item".

How do I hide navigation bar in Swift storyboard?

Click on the controller that has the top bar navigate to the properties bar on the right hand side of Xcode. There is a drop down labeled Top Bar (as shown above) change this drop down to none.


1 Answers

Try adding a Navigation Item to the controller and it should work properly

enter image description here

like image 67
KristofferArl Avatar answered Sep 23 '22 13:09

KristofferArl