I have not tried, but according to docs you can return NO from the delegate tabBarController:shouldSelectViewController:
[UPDATE] I just tried this out of curiosity - everything seems to be fine. Create a new project from the Tab Bar app template, and then go to -viewDidLoad your FirstViewController. Add this line:
[self.tabBarController setDelegate:self]
and then implement the delegation method:
-(BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController { if (userHasCompletedAction) { return YES; } return NO; }
Remember to specify <UITabBarControllerDelegate> in your .h file!
Hope this helps.
source share