iOS 自定义push转场动画
在需要使用的控制器中添加#import "BSYAnimator.h"和#import "BSYTransitionAnimator.h"两个头文件:
@property(nonatomic,strong)BSYAnimator Animator;@property(nonatomic,strong)BSYTransitionAnimator *TransitionAnimator;///遵循代理@interface ViewController ()///需要跳转的控制器@property(nonatomic,strong)TwoViewControllertwo;
在- (void)viewDidLoad 中初始化
self.Animator = [[BSYAnimator alloc]init];self.TransitionAnimator = [[BSYTransitionAnimator alloc]init];TwoViewController *two = [[TwoViewController alloc]init];self.navigationController.delegate = self;two.transitioningDelegate = self;two.modalPresentationStyle = UIModalPresentationCustom;
//然后在跳转的方法中 [self.navigationController pushViewController:self.two animated:YES];
代码下载:下载
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。