I have a UIViewController
called ListVC
. ListVC
has a UITabBar
that the user can switch tabs with. It also has UINavigationController
.
In ListVC
I have a button, that I want to push a new ViewController called DetailVC
when it's pressed (with the NavigationController
). I want to present DeatilVC
without a UITabBar
.
The problem is that when I'm using the pushViewController(animated)
method, the view still has the UITabBar
.
How can I push the view (I don't want to present it modally) above the UITabBar
?
You can see an example of it on Whatsapp
when selecting a chat from the chat list. Image:
Code:
self.navigationController?.pushViewController(detailVC, animated: true)
Thank you!
Write below code when you push:
yourViewController.hidesBottomBarWhenPushed = true
You can also hide tabbar on push from storyboard also. select view controller which you are going to push and check Hide Bottom Bar on Push:
Ok I've solved the problem. I had to add hidesBottomBarWhenPushed
twice before and after the push code:
self.hidesBottomBarWhenPushed = true
self.navigationController?.pushViewController(detailVC, animated: true)
self.hidesBottomBarWhenPushed = false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With