I know this question was asked before, but non of the answer is working for me, so I am asking it again if some new ideas come up.
I have UISplitView controller in universal app, and in master view controller I need TabBarController, like this
My problem is that with this configuration, when I tap on cell, DetailViewController did show, but it slide from the bottom and not from the right side, and it does not have back button. This let me believe that is not on the right navigation stack.
Some things that I try but is not working (and I will not accept as answer!)
- Put NavigationController before TabBarController :
This solution presents two major problem. First is a very ugly black shadow on the right side of the navigation bar when transitioning. Second is that after second click on cell, back button stop working.
Adding code
func splitViewController(splitViewController: UISplitViewController, showDetailViewController vc: UIViewController, sender: AnyObject?) -> Bool { if splitViewController.collapsed { let tabBarController = splitViewController.viewControllers.first as! UITabBarController let selectedNavigationViewController = tabBarController.selectedViewController as! UINavigationController // Push view controller var viewControllerToPush = vc if let navController = vc as? UINavigationController { viewControllerToPush = navController.topViewController } selectedNavigationViewController.pushViewController(viewControllerToPush, animated: true) return true } return false }
This does nothing for me, but it give me an error if I rotate my device multiple times :
<Error>: CGImageCreate: invalid image size: 0 x 0.
I don't believe that this could not be done. The master and detail view could be any View controllers class so why tabbarviewcontroller doesn't work?