由于现在很多页面跳转基于NavigationController,所以创建storyboard时要添加NavigationController
方法1:拖一个 Navigation Controller
1.拖一个 Navigation Controller到storeboard中。
2.把其自带的RootViewController删掉。
3.右键拖拽将NavigationController与自己的首页ViewController链接起来,并设置为root view controller。
方法2:
1:选中默认创建的viewcontroller
2:选择最上面工具栏的editor->embedin->navigation controller。
(建tabbar的可以选tabBar controller)
注意:如果要作为最开始的进入页面,需要设置navigation controller的viewcontroller为is Initial View Controller