Created
November 3, 2011 21:09
-
-
Save jweinberg/1337789 to your computer and use it in GitHub Desktop.
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
@implementation JWNavigationController | |
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated; | |
{ | |
if (viewController.navigationItem.leftBarButtonItem == nil) | |
{ | |
JKBackBarButtonItem *backItem = [[JWBackBarButtonItem alloc] initWithTitle:self.topViewController.navigationItem.title ?: @"Back" | |
target:self | |
action:@selector(doPop:)]; | |
viewController.navigationItem.leftBarButtonItem = backItem; | |
} | |
[super pushViewController:viewController animated:animated]; | |
} | |
- (void)doPop:(id)sender; | |
{ | |
[self popViewControllerAnimated:YES]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment