YSLTransitionAnimator 0.0.2

YSLTransitionAnimator 0.0.2

测试已测试
语言语言 Obj-CObjective C
许可 MIT
发布时间最新版本2015年5月

y-hryk 维护。



  • 作者:
  • y-hryk

演示

Dome Dome

要求

不支持横屏

iOS 7.0

安装

手动安装

将 YSLTransitionAnimator 目录复制到您的项目中。

使用方法

  • import YSLTransitionAnimator.h
  • import UIViewController+YSLTransition.h

推送转场

@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;
}

弹出转场

@interface ViewController () <YSLTransitionAnimatorDataSource>

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

- (void)viewDidAppear:(BOOL)animated
{
    [self ysl_addTransitionDelegate:self];
    [self ysl_popTransitionAnimationWithCurrentScrollView:nil
                                    cancelAnimationPointY:0
                                        animationDuration:0.3
                                  isInteractiveTransition:YES];
}

#pragma mark -- YSLTransitionAnimatorDataSource
- (UIImageView *)popTransitionImageView
{
    return self.headerImageView;
}

- (UIImageView *)pushTransitionImageView
{
    return nil;
}

许可证

MIT