简体   繁体   中英

How to make TabBarController inside another TabBarController in swift storyboard?

I wanna know how to create nested UITabBarControllers in Xcode, I'm using Swift.

My first UITabBarController has two items: Search ( UITableView ) and Map ( MKMapView ). When I hit a cell in my table I wanna go to the second UITabBarController . This second UITabBarController is the detail page for the clicked cell and must have three items --> Info, Reviews and Contact.

Can anyone explain how to do this? Right now I only have the first UITabBarController and a single view controller for the detail page working.

EDIT: The main problem is that when I nest the UITabBarControllers , my app always shows the items of the first UITabBarController .

Make another Tab View Controller next to it (You should see two tab view controllers on the storyboard), and then inside the Tab View Controller you want the other one in, insert a Container View. After the Container View is in the desired Tab View Controller and sized properly, hold control and drag from the Container View to the other Tab View Controller. After releasing, select embed and you should be good to go! Hope this helps. If it does, please vote this up :)

Drag and drop new tabbarcontroller from stroryboard and from your list view controller ctrl+drag to this newtabbar controller and select show segue . (assuming that you are using navigation controller)

I found the answer by myself.

Just create a segue between the list view and the second tab controller. And select on the second tab controller hide bottom bar on push in the attributes inspector.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM