登录 立即注册
金钱:

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

图片 浏览转场动画效果 YSLTransitionAnimator

[复制链接]
来自: 李世铿 分类: iOS精品源码 上传时间: 2016-4-28 12:52:04

项目介绍:

Requirement(环境要求)
not support landscape
iOS 7.0

InstallManually (手动安装)
Copy YSLTransitionAnimator directory to your project. (将 YSLTransitionAnimator 复制到项目中
CocoaPods
Add pod 'YSLTransitionAnimator' to your Podfile. (在podfile文件中添加pod 'YSLTransitionAnimator'

Usage(使用)
  • import YSLTransitionAnimator.h
  • import UIViewController+YSLTransition.h

Push Transition
[Objective-C] 查看源文件 复制代码
@interface ViewController () <YSLTransitionAnimatorDataSource>

- (void)viewWillDisappear:(BOOL)animated
{
    [self ysl_removeTransitionDelegate];
}

- (void)viewDidAppear:(BOOL)animated
{
    float statusHeight = [[UIApplication sharedApplication] statusBarFrame].size.height;
    float navigationHeight = self.navigationController.navigationBar.frame.size.height;

    [self ysl_addTransitionDelegate:self];
    [self ysl_pushTransitionAnimationWithToViewControllerImagePointY:statusHeight + navigationHeight
                                                   animationDuration:0.3];
}

#pragma mark -- YSLTransitionAnimatorDataSource
- (UIImageView *)pushTransitionImageView
{
    CollectionCell *cell = (CollectionCell *)[self.collectionView cellForItemAtIndexPath:[[self.collectionView indexPathsForSelectedItems] firstObject]];
    return cell.itemImage;
}

- (UIImageView *)popTransitionImageView
{
    return nil;
}



Pop Transition
[Objective-C] 查看源文件 复制代码
@interface ViewController () <YSLTransitionAnimatorDataSource>

- (void)viewWillDisappear:(BOOL)animated
{
    [self ysl_removeTransitionDelegate];
}

- (void)viewDidAppear:(BOOL)animated
{
    float statusHeight = [[UIApplication sharedApplication] statusBarFrame].size.height;
    float navigationHeight = self.navigationController.navigationBar.frame.size.height;
    [self ysl_addTransitionDelegate:self];
    [self ysl_popTransitionAnimationWithCurrentScrollView:self.tableView
                                    cancelAnimationPointY:self.headerImageView.frame.size.height - (statusHeight + navigationHeight)
                                        animationDuration:0.3
                                  isInteractiveTransition:YES];
}

#pragma mark -- YSLTransitionAnimatorDataSource

- (UIImageView *)pushTransitionImageView
{
    return nil;
}

- (UIImageView *)popTransitionImageView
{
    return self.headerImageView;
}






相关源码推荐:

我来说两句
*滑动验证:
所有评论(92)
赵涂涂 2016-4-28 13:18:10
强烈支持楼主ing……
回复
ogqs0493 2016-4-28 13:58:40
强烈支持楼主ing……
回复
ogqs0493 2016-4-28 13:59:54
精华内容,楼主V5!
回复
sest603 2016-4-28 14:41:34
楼主威武啊,Code4App有你更给力!
回复
hongdong 2016-4-28 15:01:31
虽不明,但觉厉!
回复
zj1120945610 2016-4-29 09:47:09
虽不明,但觉厉!
回复
wenjf 2016-4-29 10:12:45
很给力,Code4App有你更精彩!
回复
yy55yyo 2016-4-29 10:34:29
楼主威武啊,Code4App有你更给力!
回复
code4app热心网友 2016-4-29 10:34:30
学习学习!
回复
提取码:  下载次数:110 状态:已购或VIP 售价:0(原价:5)金钱 下载权限:初级码农 
3316 0 110
联系我们
首页/微信公众账号投稿

帖子代码编辑/版权问题

QQ:435399051,742864542

如何获得代码达人称号?

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

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

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