hide tab bar in view with push hide tab bar in view with push swift swift

hide tab bar in view with push


enter image description here

Make sure to check this option only on the ViewController whose tab bar you wish to be hidden.

Thanks to iHarshil for the suggestion.


In the viewDidload set the UIViewController hidesBottomBarWhenPushed to yes:

self.hidesBottomBarWhenPushed = YES;

This way the UINavigationController takes care of hiding the tab bar.


Use in prepareForSegue:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {    if ([segue.identifier isEqualToString:@"showRecipeDetail"]) {        NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];        RecipeDetailViewController *destViewController = segue.destinationViewController;        destViewController.recipeName = [recipes objectAtIndex:indexPath.row];        // Hide bottom tab bar in the detail view        destViewController.hidesBottomBarWhenPushed = YES;    }}