简体   繁体   中英

UITabBarController Tab Modal Presentation -Swift2 OS

I have a tabBarController with 2 tabs: tab1 and tab2. I have a button named pressButton in tab1. When pressed it automatically switches to tab2. How do I present tab2 modally upon switching tabs?

The thing is I want to keep both tabs visible at the bottom after the modal presentation. The docs say that a modal presentation will completely take over the entire screen. I don't want the modal to hide the bottom tabBarController tabs. How would I do this?

@IBOutlet func pressButton(sender: UIButton){
   self.tabBarController!.selectedIndex = 1
}

For customization of tab bar use the following link

Customization of Tabbar using button

in the button actions, use the modal animation for displaying the tabbar.

Happy Coding...

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