2 Star 3 Fork 0

baishiyun / PushAnimation

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

在需要使用的控制器中添加#import "BSYAnimator.h"和#import "BSYTransitionAnimator.h"两个头文件:

@property(nonatomic,strong)BSYAnimator *Animator; @property(nonatomic,strong)BSYTransitionAnimator TransitionAnimator; ///遵循代理 @interface ViewController ()<UINavigationControllerDelegate,UIViewControllerTransitioningDelegate> ///需要跳转的控制器 @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];

实现代理方法 #pragma mark - UINavigationControllerDelegate iOS7新增的2个方法 // 动画特效

  • (id) navigationController:(UINavigationController *)navigationController animationControllerForOperation:(UINavigationControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC {

    if (operation == UINavigationControllerOperationPush) { return self.Animator; }else{ return nil; } } #pragma mark - Transitioning Delegate (Modal) -(id)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source { self.TransitionAnimator.animationType = AnimationTypePresent; return self.TransitionAnimator; }

-(id)animationControllerForDismissedController:(UIViewController *)dismissed { self.TransitionAnimator.animationType = AnimationTypeDismiss; return self.TransitionAnimator; }

空文件

简介

push自定义转场动画 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/baishiyun/PushAnimation.git
git@gitee.com:baishiyun/PushAnimation.git
baishiyun
PushAnimation
PushAnimation
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891