RMPZoomTransitionAnimator

A custom zooming transition animation for UIViewController

  • 所有者: recruit-mp/RMPZoomTransitionAnimator
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

RMPZoomTransitionAnimator

Version
License
Platform

Overview

RMPZoomTransitionAnimator provide a custom transition zooming animation.

Not only UICollectionView, this is possible to use any other UIViewController transition.

This transition animation is like the "Pinterest" animation, but this is very simple and small library.

Screen shot
Screen shot

Installation

RMPZoomTransitionAnimator is available through CocoaPods.
To install
it, simply add the following line to your Podfile:

pod "RMPZoomTransitionAnimator"

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Setup is as below:

Use for an UINavigationController push transition

Refer to the example project for details.

  • Import RMPZoomTransitionAnimator.h
  • Adopt RMPZoomTransitionAnimating
  • Implement the RMPZoomTransitionAnimating protocol below, both source view controller and destination view controller
    1. - (UIImageView *)transitionSourceImageView
    2. - (UIColor *)transitionSourceBackgroundColor
    3. - (CGRect)transitionDestinationImageViewFrame
  • Returns RMPZoomTransitionAnimator instance in the UINavigationController delegate method
- (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;
}

Use for a modal transition

Refer to the example project for details.

  • Import RMPZoomTransitionAnimator.h
  • Adopt RMPZoomTransitionAnimating
  • Implement RMPZoomTransitionAnimating protocol below, both source view controller and destination view controller
    1. - (UIImageView *)transitionSourceImageView
    2. - (UIColor *)transitionSourceBackgroundColor
    3. - (CGRect)transitionDestinationImageViewFrame
  • Set the transitioningDelegate in prepareForSegue:sender:
  • Returns RMPZoomTransitionAnimator instance in the UIViewControllerTransitioningDelegate method
- (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;
}

Requirements

  • iOS 7.0 or higher

Change Log

1.0.3

  • Add option to change default animation duration
  • Fixed black screen

1.0.2

  • Remove alpha view and source image view from superview when completed

1.0.1

  • Adds animation completion handler

1.0.0

  • First release.

Contribution

If you have feature requests or bug reports, feel free to help out by sending pull requests or by creating new issues.

Author

Masato Oshima
Recruit Marketing Partners Co.,Ltd. recruit_mp_oss@ml.cocorou.jp

License

RMPZoomTransitionAnimator is available under the MIT license.

主要指標

概覽
名稱與所有者recruit-mp/RMPZoomTransitionAnimator
主編程語言Objective-C
編程語言Ruby (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2015-03-31 12:20:00
推送於2017-08-23 09:04:09
最后一次提交2017-05-04 17:28:34
發布數4
最新版本名稱1.0.3 (發布於 )
第一版名稱1.0.0 (發布於 )
用户参与
星數1.7k
關注者數47
派生數178
提交數50
已啟用問題?
問題數16
打開的問題數10
拉請求數7
打開的拉請求數1
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?