Created
May 29, 2011 12:52
-
-
Save steipete/997756 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
// this is implemented, but not declared. we add the category to fix the warning | |
// (since super cannot be casted any longer in clang) | |
@interface UINavigationController(AMInternal) | |
- (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item; | |
@end | |
@implementation AMNavigationController | |
/////////////////////////////////////////////////////////////////////////////////////////////////// | |
#pragma mark - UINavigationBarDelegate | |
- (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item { | |
static BOOL change_once = NO; | |
if (!change_once && isIPad()) { | |
change_once = YES; | |
CATransition* transition = [CATransition animation]; | |
transition.duration = kAMGridFadeAnimationDuration; | |
transition.type = kCATransitionFade; | |
transition.subtype = kCATransitionFromTop; | |
[self.view.layer addAnimation:transition forKey:kCATransition]; | |
[self popViewControllerAnimated:NO]; | |
//[navigationBar popNavigationItemAnimated:NO]; | |
return NO; | |
}else { | |
change_once = NO; | |
[super navigationBar:navigationBar shouldPopItem:item]; | |
return YES; | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment