登录 立即注册
金钱:

Code4App-iOS开发-iOS 开源代码库-iOS代码实例搜索-iOS特效示例-iOS代码例子下载-Code4App.com

RMPZoomTransitionAnimator

[复制链接]
来自: 李世铿 分类: iOS精品源码 上传时间: 2016-4-12 17:42:52
Tag:transition animation modal transition animation modal

项目介绍:

总览
RMPZoomTransitionAnimator提供了一个可自定义的缩放动画功能
不止  UICollectionView, 可用于其它 UIViewController 的切换动画.


安装
RMPZoomTransitionAnimator 支持 cocoapods,
需要在 Podfile 文件中添加以下一行,并执行 pod install:
pod "RMPZoomTransitionAnimator"使用

UINavigationController push 过渡动画实现步骤
详细可参阅demo哦!
  • 导入头文件 RMPZoomTransitionAnimator.h
  • Adopt RMPZoomTransitionAnimating
  • Implement the RMPZoomTransitionAnimating protocol below, both source view controller and destination view controller
    • - (UIImageView *)transitionSourceImageView
    • - (UIColor *)transitionSourceBackgroundColor
    • - (CGRect)transitionDestinationImageViewFrame
  • Returns RMPZoomTransitionAnimator instance in the UINavigationController delegate method
[Objective-C] 查看源文件 复制代码
- (id <UIViewControllerAnimatedTransitioning>)navigationController:(UINavigationController *)navigationController
                                   animationControllerForOperation:(UINavigationControllerOperation)operation
                                                fromViewController:(UIViewController *)fromVC
                                                  toViewController:(UIViewController *)toVC
{
    // minimum implementation for example
    RMPZoomTransitionAnimator *animator = [[RMPZoomTransitionAnimator alloc] init];
    animator.goingForward = (operation == UINavigationControllerOperationPush);
    animator.sourceTransition = (id<RMPZoomTransitionAnimating>)fromVC;
    animator.destinationTransition = (id<RMPZoomTransitionAnimating>)toVC;
    return animator;
}




modal transition modal 过渡动画实现步骤
  • 导入头文件 RMPZoomTransitionAnimator.h
  • Adopt RMPZoomTransitionAnimating
  • Implement RMPZoomTransitionAnimating protocol below, both source view controller and destination view controller
    • - (UIImageView *)transitionSourceImageView
    • - (UIColor *)transitionSourceBackgroundColor
    • - (CGRect)transitionDestinationImageViewFrame
  • Set the transitioningDelegate in prepareForSegue:sender:
  • Returns RMPZoomTransitionAnimator instance in the UIViewControllerTransitioningDelegate method
[Objective-C] 查看源文件 复制代码
- (id<UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented
                                                                  presentingController:(UIViewController *)presenting
                                                                      sourceController:(UIViewController *)source
{
    // minimum implementation for example
    RMPZoomTransitionAnimator *animator = [[RMPZoomTransitionAnimator alloc] init];
    animator.goingForward = YES;
    animator.sourceTransition = (id<RMPZoomTransitionAnimating>)source;
    animator.destinationTransition = (id<RMPZoomTransitionAnimating>)presented;
    return animator;
}

- (id<UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed
{
    // minimum implementation for example
    RMPZoomTransitionAnimator *animator = [[RMPZoomTransitionAnimator alloc] init];
    animator.goingForward = NO;
    animator.sourceTransition = (id<RMPZoomTransitionAnimating>)dismissed;
    animator.destinationTransition = (id<RMPZoomTransitionAnimating>)self;
    return animator;
}



环境
  • iOS 7.0 or higher




相关源码推荐:

我来说两句
*滑动验证:
所有评论(72)
sukai212 2016-4-12 19:31:52
楼主用心了,内容非常精彩。
回复
shiwuoo 2016-4-12 19:32:26
精华内容,楼主V5!
回复
sqqq 2016-4-12 23:41:03
感谢分享,Code4App有你更精彩:)
回复
wx_numfV8vK 2016-4-13 00:04:11
淡定,淡定,淡定……
回复
heda4866886 2016-4-13 08:59:01
淡定,淡定,淡定……
回复
codemzj 2016-4-13 09:23:19
精华内容,楼主V5!
回复
qand0404 2016-4-13 09:38:15
精华内容,楼主V5!
回复
qand0404 2016-4-13 09:52:01
虽不明,但觉厉!
回复
mao_ppp 2016-4-13 09:56:46
感谢分享,Code4App有你更精彩:)
回复
提取码:  下载次数:112 状态:已购或VIP 售价:0(原价:5)金钱 下载权限:初级码农 
2327 0 112
联系我们
首页/微信公众账号投稿

帖子代码编辑/版权问题

QQ:435399051,742864542

如何获得代码达人称号?

代码贡献英雄榜
用户名 下载数
通过邮件订阅最新 Code4App 信息
上一条 /4 下一条
联系我们
关闭
合作电话:
13802416937
Email:
435399051@qq.com
商务市场合作/投稿
问题反馈及帮助
联系我们

广告投放| Github|申请友链|手机版|Code4App ( 粤ICP备15117877号-1 )

快速回复 返回顶部 返回列表