Hiding UITabBar when pushing a UIView Hiding UITabBar when pushing a UIView swift swift

Hiding UITabBar when pushing a UIView


This is better:

viewController.hidesBottomBarWhenPushed = YES;[self.navigationController pushViewController:viewController animated:YES];

You have to set hidesBottomBarWhenPushed = YES on the controller you are going to push into the view...


when working with storyboard its easy to setup view controller which will hide the tabbar on push, on the destination view controller just select this checkbox:
enter image description here


I've figure out how to get this solved, I was running into the same issue, but Apple also tells us how to do it in the sample called: "The Elements" (http://developer.apple.com/library/ios/#samplecode/TheElements/Introduction/Intro.html)

See function below on how to do it, add this to the init function of the view you want to push in!

-(id) init {     if(self = [super init]) {         self.hidesBottomBarWhenPushed = YES;     }     return self; }

It will automatically hide the tabbar like the photo app does on your iphone. And when you navigate back the parent view will just show the tabbar again.

Good luck