pkdkk
pkdkk

Reputation: 3961

Hide a Tab on tabBarController from a view controller

Is it possible to hide / deactivate a Tab on a UITabBarController ??

And how?

Upvotes: 0

Views: 81

Answers (1)

Tomasz Zabłocki
Tomasz Zabłocki

Reputation: 1326

It's possible to deactivate it, use following delegate method:

- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController; 
{
    if (viewControllerYouWantToDeactivate == viewController)
    {
        return NO;
    }
    else
    {
        return YES;
    }   
}

Don't forget to set delegate of your UITabBarController.

You can find delegate documentation here

Upvotes: 1

Related Questions