In Interface Builder:
- Create an
UITabBarController
and set it as the initial View Controller.
- Create an
UITableViewController
.
- Select the
UITableViewController
and go to the menu bar > Editor > Embed in > Navigation Controller
.
- Select your
UITabBarController
and CTRL-drag from it to the UINavigationController
.
- Choose
Relationship Segue > view controllers
.
- Now, any View Controller you will add in the
UINavigationController
stack will be presented in the same UITabBarController
.
To perform a segue from the first-in-stack UITableViewController
connected to the UINavigationController
, to another ViewController you must of course first create another ViewController, create a segue to it in Interface Builder
, create an identifier for your segue and in your code perform it by calling the appropriate function in Swift like:
optional func performSegueWithIdentifier(_ identifier: String,
sender sender: AnyObject?)
Here's a sample on how your Interface Builder could look like:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…