#import "UINavigationController+ja.h"

// 扩展NavigationController中的方法(catagory)

@implementation UINavigationController (ja)

- (void)pushAnimationDidStop {
}

- (void)pushViewController: (UIViewController*)controller
    animatedWithTransition: (UIViewAnimationTransition)transition {
[self pushViewController:controller animated:NO];

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:TT_FLIP_TRANSITION_DURATION];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(pushAnimationDidStop)];
[UIView setAnimationTransition:transition forView:self.view cache:YES];
[UIView commitAnimations];
}

- (UIViewController*)popViewControllerAnimatedWithTransition:(UIViewAnimationTransition)transition {
UIViewController* poppedController = [self popViewControllerAnimated:NO];

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:TT_FLIP_TRANSITION_DURATION];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(pushAnimationDidStop)];
[UIView setAnimationTransition:transition forView:self.view cache:NO];
[UIView commitAnimations];

return poppedController;
}

 

@end

相关文章:

  • 2021-12-13
  • 2022-03-09
  • 2022-12-23
  • 2021-12-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-16
  • 2022-12-23
  • 2021-10-07
  • 2021-08-13
  • 2021-04-27
相关资源
相似解决方案