-1

I am working in a swift 3 xcode 8 project, and I have an issue.

I have some view controllers. In the first one I've inserted a navigation controller, which gives me the "back" button when I am in another view controller. So I can go on and back to the first viewcontroller.

The thing is, lets say, when I am in the third view controller I'd like to insert a button, but appearing just in this viewcontroller in the navigation controller.

I've tried adding a bar button item but it doesnt work because the navigation controller only appears, in the storyboard, in my first viewcontroller.

So how can I add buttons to the navigation controller, in another viewcontrollerS?

H.N.
  • 1,207
  • 2
  • 12
  • 28
  • But what is your problem exactly? if you insert a button on the 2nd/3rd viewcontroller that button will only appear on such viewcontroller nav-bar, it's the normal behaviour and looks like it is what you want. what do you mean with "only appears, in the storyboard, in my first viewcontroller"? – jalone Oct 27 '16 at 14:09
  • I make my navigation with segues and also whithout segues (programaticly). So in this second case I don't get the navigation bar in the storyboard. So I can I add button to navigation bar, in this viewcontrollers? – H.N. Oct 27 '16 at 14:21
  • So, If I add a button, the navigation controller bar (with back button) appears on the top and I think the button is on the bottom. Anyway t doesnt appear – H.N. Oct 27 '16 at 14:25

1 Answers1

0

So how can I add buttons to the navigation controller, in another viewcontrollerS

Drag a Navigation Item into your third view controller. Now you can add bar button items to that.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • That's no answer. What I'm describing is how you do it. What _you_ are doing, I have no idea. – matt Oct 27 '16 at 14:22
  • What I meant to say was, I've dragged a Navigation Item into my view controller. And than I added a bar button item. But it is not showing when I run the simulator. WHen I run simulator I get navigation controller with title and back button only. – H.N. Oct 27 '16 at 14:34
  • Wait a minute. I've tried that again I it worked. Strange. I did some thing now it worked. Thanks – H.N. Oct 27 '16 at 14:39