1
votes

I'm in XCode 7.2.1 and I am trying to make a view that is reusable and should have some custom elements in the navigation bar.

If I would add a view to my storyboard, connect it via a segue to the navigation controller and make sure there is a "Navigation Item" in the view, I could see the navigation bar and edit my items in it.

If I manually add a Navigation Item to a XIB however I can't see anything. Even if I switch in the simulated metrics settings Top Bar to something else than Inferred or None.

I don't want to use the storyboard, if possible. Is there a descent way to make the navigation item visible and edit it?

Thanks in advance.

1

1 Answers

0
votes

I don't think you link your View Controller correctly with Navigation Controller. When you link it, you should choose with root View Controller. If you link it correctly, you don't have to add NavigationItem manually.

By the way, you shouldn't do the customization for Navigation bar directly in xib. All you can do is only to set the Title, Prompt and Back Button text.

Do it in code! I think you won't have different styles for navigation bar in different views, right? That would be too silly.