UISplitViewController inside UITabBarVC: showDetail and hide tab bar

440 Views Asked by At

When I try to show view controller in UISplitView, I need to hide tab bar. I try use hidesBottomBarWhenPushed, but its not works. Is it possible to hide tab bar on showDetail without smell code? (like viewwillappear etc)

2

There are 2 best solutions below

0
thachnb On

Call this when you want to hide your tab bar:

[self.tabBarController.tabBar setHidden:YES];
0
Rahul On

Without code, it's not possible to do so. Add these lines in splitViewController class.

Swift 3:

override func viewWillAppear(animated: Bool) {
    super.viewWillAppear(animated) 
    self.tabBarController?.tabBar.isHidden = true
}

override func viewWillDisappear(animated: Bool) {
    super.viewWillAppear(animated) 
    self.tabBarController?.tabBar.isHidden = false
}