Reputation: 120324
How can I detect when the special More tab of UITabBarController
is selected?
tabBarController:didSelectViewController:
tells me when a tab was selected, including the More tab. However, how can I know that the given UIViewController
is actually the More tab?
At first I though about using the index, but that would assume that the More tab will be in the same position. Also, the title ("More") appears to be localised.
Upvotes: 3
Views: 1720
Reputation:
An alternative approach:
if (tabBarController.selectedIndex == NSNotFound) {
// etc.
}
Upvotes: 2
Reputation: 120324
Found it right after posting the question:
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
if (tabBarController.moreNavigationController == viewController) {
NSLog(@"More");
}
}
Upvotes: 4