Try to implement – tabBarController:shouldSelectViewController:
method of UITabBarControllerDelegate
in such way:
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController {
BOOL shouldSelect = YES;
NSInteger tabToIgnore = 3;
if ([tabBarController.viewControllers indexOfObject:viewController] == tabToIgnore) {
shouldSelect = NO;
[self performSpecificAction];
}
return shouldSelect;
}
When you initialise UITabBarController
object with list of view controllers you can use simply [[UIViewController alloc] init]
for index 3.