Prevent tabbar from changing tab at specific index - IOS
问题 Thanks for reading my question. I'm trying to implement a popup menu when a user clicks the tab with the index of 4. So I'm trying to prevent the tabbar from switching viewcontroller when index 4 is pressed. Here is my code: - (BOOL) tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController { if(viewController == [tabBarController.viewControllers objectAtIndex:4]){ NSLog(@"NO"); return NO; }else{ NSLog(@"YES"); return YES; } } I've