Ihor M.
Ihor M.

Reputation: 302

UISplitViewController inside UITabBarVC: showDetail and hide tab bar

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)

Upvotes: 0

Views: 475

Answers (2)

Rahul
Rahul

Reputation: 332

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
}

Upvotes: 1

thachnb
thachnb

Reputation: 1533

Call this when you want to hide your tab bar:

[self.tabBarController.tabBar setHidden:YES];

Upvotes: 0

Related Questions