0

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
}
rmaddy
  • 314,917
  • 42
  • 532
  • 579
Lance Samaria
  • 17,576
  • 18
  • 108
  • 256

1 Answers1

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...

Dhanunjaya
  • 500
  • 1
  • 5
  • 13
  • thanks I'll try it this weekend and if all good I'll use as the accepted answer. Much appreciated!!! – Lance Samaria Sep 28 '16 at 18:45
  • Soory for taking so long, I just got a chance to read the link you sent. It's a god link but it;s not what I'm looking for. I already have the tabBarController in Storyboard. What I need to do id change how the tab get presented, I want 1 of the tabs to be presented modally. Your example would work but I already have a ton of code using the tabBArController and each tab. it would be a lot of work to redo everything over. There has to be some animation to modally present a tab using the tabBar. – Lance Samaria Oct 06 '16 at 17:32
  • http://stackoverflow.com/questions/5161730/iphone-how-to-switch-tabs-with-an-animation Check this link – Dhanunjaya Oct 07 '16 at 04:51