Created
March 26, 2010 11:31
-
-
Save mborromeo/344787 to your computer and use it in GitHub Desktop.
[iPhone] Force a view to pop to its root when a UITabBarController button is pressed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This function will force a view to pop to its root when a UITabBarController button is pressed | |
- (void)tabBarController:(UITabBarController *)tabBarController | |
didSelectViewController:(UIViewController *)viewController { | |
// self is Application Delegate | |
[[self navigationController] popToRootViewControllerAnimated:NO]; | |
if ([viewController isKindOfClass:[UINavigationController class]]) { | |
[(UINavigationController *)viewController popToRootViewControllerAnimated:NO]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment