1,添加框架QuartzCore.framework和头文件#import <QuartzCore/CAAnimation.h>
2,push
//动画
CATransition* transition = [CATransition animation];
transition.delegate = self;
transition.type = kCATransitionPush;//可更改为其他方式
transition.subtype = kCATransitionFromBottom;//可更改为其他方式
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[self.navigationController popViewControllerAnimated:YES];
3,pop
//动画
CATransition* transition = [CATransition animation];
transition.delegate = self;
transition.type = kCATransitionPush;//可更改为其他方式
transition.subtype = kCATransitionFromBottom;//可更改为其他方式
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[self.navigationController popViewControllerAnimated:YES];