4

I have a TabBarController with 5 TabBarItems (build with IB). So far, so good. But, when I tap the second item for example, I want that my second view controller appear with a modal segue. I don’t understand the way to fix it with a TabBarController…

Anyone could help me please ?

  • Have you tried this? -> http://stackoverflow.com/questions/10901006/ios-programmatic-modal-segue-with-animation-such-as-flip – Andre Simon Dec 11 '15 at 00:24

1 Answers1

1

Would it help if you subclassed the tab bar controller and implemented your own segue transitions where appropriate?

Specify the delegates UITabBarControllerDelegate in your UITabBarController subclass and implement the function

func tabBarController(tabBarController: UITabBarController, shouldSelectViewController viewController: UIViewController) -> Bool

to trap the selection.

Create a transition that inherits from UIViewControllerAnimatedTransitioning using a custom Class and use this to display and hide the tab as and when necessary.

FractalDoctor
  • 2,496
  • 23
  • 32