Adding buttons to navigation controllers

2019-09-19 09:52发布

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?

1条回答
地球回转人心会变
2楼-- · 2019-09-19 10:11

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.

查看更多
登录 后发表回答