TalkingCode
TalkingCode

Reputation: 13557

iOS navigation has no navigation item

In the current version of Xcode a few things seems to work a bit different. I have a little problem working with a simple navigation. This is what I do:

Now both scenes will get a gray bar at the top but only the first scene will also get a Navigation Item. Only for the first scene I am able to edit a title attribute and only for the first scene I am able to add a Bar Button.

Navigation itself works fine. The title of the first scene is the text of the Back-button in the second scene.

Why has the second scene no Navigation Item?

Is it because of the segue type?

Upvotes: 1

Views: 170

Answers (3)

Erik
Erik

Reputation: 2530

What I do is to drag a navigation item from the list of controls to the top, gray bar on the second ViewController. Then you can drag other items such as bar buttons onto it, as well as being able to edit the title.

Upvotes: 0

ashhanai
ashhanai

Reputation: 234

IB will automatically add UINavigationItem to root view controller of your UINavigationController.

To the rest of your controllers in navigation flow you need to add UINavigationItem manually from IB Object library.

Upvotes: 1

Yogesh Suthar
Yogesh Suthar

Reputation: 30488

Yeah, its a bug in Xcode from version 6. If you want Navigation Item in second view controller too, then there is a hack to get it.

Change the seque type from show to push. Now Navigation Item will appear in second VC too. You can again change the seque type from push to show, the Navigation Item will still present in second VC.

Upvotes: 2

Related Questions