A library of custom iOS View Controller Animations and Interactions.

Overview

RZTransitions

Build Status

RZTransitions is a library to help make iOS7 custom View Controller transitions slick and simple.

Overview

Installation

CocoaPods (Recommended)

Add the following to your Podfile:

pod 'RZTransitions'

RZTransitions follows semantic versioning conventions. Check the releases page for the latest updates and version history.

Manual Installation

Copy and add all of the files in the RZTransitions directory (and its subdirectories) into your project.

Setting a New Default Transition

Swift

RZTransitionsManager.shared().defaultPresentDismissAnimationController = RZZoomAlphaAnimationController()
RZTransitionsManager.shared().defaultPushPopAnimationController = RZCardSlideAnimationController()

Objective-C

id<RZAnimationControllerProtocol> presentDismissAnimationController = [[RZZoomAlphaAnimationController alloc] init];
id<RZAnimationControllerProtocol> pushPopAnimationController = [[RZCardSlideAnimationController alloc] init];
[[RZTransitionsManager shared] setDefaultPresentDismissAnimationController:presentDismissAnimationController];
[[RZTransitionsManager shared] setDefaultPushPopAnimationController:pushPopAnimationController];

When Presenting a View Controller

Swift

self.transitioningDelegate = RZTransitionsManager.shared()
let nextViewController = UIViewController()
nextViewController.transitioningDelegate = RZTransitionsManager.shared()
self.presentViewController(nextViewController, animated:true) {}

Objective-C

[self setTransitioningDelegate:[RZTransitionsManager shared]];
UIViewController *nextViewController = [[UIViewController alloc] init];
[nextViewController setTransitioningDelegate:[RZTransitionsManager shared]];
[self presentViewController:nextViewController animated:YES completion:nil];

When creating a Navigation Controller ( or use RZTransitionsNavigationController )

Swift

let navigationController = UINavigationController()
navigationController.delegate = RZTransitionsManager.shared()

Objective-C

UINavigationController *navigationController = [[UINavigationController alloc] init];
[navigationController setDelegate:[RZTransitionsManager shared]];

Specifying Transitions for Specific View Controllers

Swift

RZTransitionsManager.shared().setAnimationController( RZZoomPushAnimationController(),
    fromViewController:self.dynamicType,
    toViewController:RZSimpleCollectionViewController.self,
    forAction:.PushPop)

Objective-C

// Use the RZZoomPushAnimationController when pushing from this view controller to a
// RZSimpleCollectionViewController or popping from a RZSimpleCollectionViewController to
// this view controller.
[[RZTransitionsManager shared] setAnimationController:[[RZZoomPushAnimationController alloc] init]
                                   fromViewController:[self class]
                                     toViewController:[RZSimpleCollectionViewController class]
                                            forAction:RZTransitionAction_PushPop];

Hooking up Interactors

Swift

override func viewDidLoad() {
    super.viewDidLoad()

    self.presentInteractionController = RZVerticalSwipeInteractionController()
    if let vc = self.presentInteractionController as? RZVerticalSwipeInteractionController {
        vc.nextViewControllerDelegate = self
        vc.attachViewController(self, withAction:.Present)
    }
}

override func viewWillAppear(animated: Bool)
{
    super.viewWillAppear(animated)
    RZTransitionsManager.shared().setInteractionController( self.presentInteractionController,
        fromViewController:self.dynamicType,
        toViewController:nil,
        forAction:.Present)
}

Objective-C

@property (nonatomic, strong) id<RZTransitionInteractionController> presentInteractionController;

- (void)viewDidLoad
{
   [super viewDidLoad];
	// Create the presentation interaction controller that allows a custom gesture
	// to control presenting a new VC via a presentViewController
   self.presentInteractionController = [[RZVerticalSwipeInteractionController alloc] init];
   [self.presentInteractionController setNextViewControllerDelegate:self];
   [self.presentInteractionController attachViewController:self withAction:RZTransitionAction_Present];
}

- (void)viewWillAppear:(BOOL)animated
{
   [super viewWillAppear:animated];
	//  Use the present interaction controller for presenting any view controller from this view controller
   [[RZTransitionsManager shared] setInteractionController:self.presentInteractionController
                                        fromViewController:[self class]
                                          toViewController:nil
                                                 forAction:RZTransitionAction_Present];
}

Features

  • A comprehensive library of animation controllers
  • A comprehensive library of interaction controllers
  • Mix and match any animation controller with any interaction controller
  • A shared instance manager that helps wrap the iOS7 custom transition protocol to expose a friendlier API

You can use any of the animation controllers or interaction controllers without the RZTransitionsManager and simply use them with the iOS7 custom View Controller transition APIs.

Maintainers

arrouse (@arrouse88)

nbonatsakis (@nickbona)

dostrander (@_Derko)

markpragma (@markpragma )

rztakashi

Contributors

smbarne (@smbarne)

License

RZTransitions is licensed under the MIT license. See the LICENSE file for details.

Comments
  • RZCirclePushAnimationController dismiss background Black,so bad UE Experience

    RZCirclePushAnimationController dismiss background Black,so bad UE Experience

    When set default Present VC user RZCirclePushAnimationController While enter vc,good circle looking But~~~!!!! When leave,after the circle animation,is black,bad looking While animation finished,User be dazzled,so bad

    can you fix this QA? Very think!

    opened by wujiangwei 8
  • Code cleanup, comments, analyzer warnings.

    Code cleanup, comments, analyzer warnings.

    @Raizlabs/maintainers-ios This is just some cleanup of this repo.

    • Adds light commenting to all non-demo headers.
    • Fixes some analyzer warnings.
    • Removes Dependency on PCH file.
    • some code style updates.

    Any input around the content in comments/code style can just be made on this branch, unless a discussion is desired.

    opened by alexrrouse 5
  • RZVerticalSwipeInteractionController Bug

    RZVerticalSwipeInteractionController Bug

    Seems it breaks up UIViewController hierarchy in some situation.

    1: Run RZTransition-Demo. 2: Push "present" and open modal view, 3: Swipe down view with interaction transitioning. 4: While swiping down, swiping up and try to cancel. 5: It breaks transition and present modal view action.

    opened by fladdict 3
  • Create a RZTransition NavigationDelegate Helper

    Create a RZTransition NavigationDelegate Helper

    Create an object that can be assigned as the nav controller's delegate for transitions.

    • [ ] It should contain a map of what VC classes to transition between and what transition to use.
    • [ ] It should have a default transition to use if no specific mappings are found
    • [ ] It should set the positive or negative direction on an RZTransition if the transition complies with the protocol based on a push or pop.

    Optional / Further Work

    • [ ] Create an object that can be assigned as the transition delegate. It should handle present and dismiss animations. If possible, this object could/should be the same as the nav controller delegate helper.
    enhancement 
    opened by smbarne 3
  • Zoom out from a Point animation.

    Zoom out from a Point animation.

    Basically i am trying write an animation where the presented controller expends from a fixed x,y point. something like: https://dl.dropboxusercontent.com/u/21062535/animation.mov Also when dismissed the presented controller should shrink back into that x,y position.

    opened by hammad 2
  • Singleton pattern

    Singleton pattern

    Should RZTransitionsManager be used always as a singleton? I have 2 Separated navigation controller and i want assign a default different transition to each. Is it possible?

    opened by eugeniobaglieri 1
  • RZBaseSwipeInteractionController short circuits interactive transitions [#46]

    RZBaseSwipeInteractionController short circuits interactive transitions [#46]

    • Fixes an issue where RZBaseSwipeInteractionController was canceled as soon as the gesture started tracking
    • Cleanup RZCirclePushAnimationController after the animation is completed. Fixes an issue where the modal Present animation would end up in a stuck state after canceling a transition.
    opened by bskinner 1
  • RZBaseSwipeInteractionController short circuits interactive transitions

    RZBaseSwipeInteractionController short circuits interactive transitions

    #29 introduces an issue which breaks interactive transitions backed by the RZBaseSwipeInteractionController. The transition is canceled before the gesture actually ends which prevents normal completion behaviors from taking place.

    opened by bskinner 1
  • Issue 33 collectionview doesn't fill screen

    Issue 33 collectionview doesn't fill screen

    This fixes issue #33 (which is a duplicate of issue #22) This also provides a utility category on NSObject that isolates the iOS7 vs. iOS8 methods for getting the corrent to and from views from an id<UIViewControllerContextTransitioning>

    opened by mr-fixit 1
  • RZZoomPushAnimationController calls viewWillAppear:

    RZZoomPushAnimationController calls viewWillAppear:

    My UIViewController had its viewWillAppear: method getting called twice – once by RZZoomPushAnimationController and then again by the system, causing some unnecessary work to be done. RZZoomPushAnimationController's animateTransition: method explicitly calls [toViewController viewWillAppear:YES]. This seems wrong to me because the system already automatically calls UIViewController's viewWillAppear: when appropriate.

    I haven't read any documentation to indicate that viewWillAppear: should ever be explicitly called. Is its use here an undocumented bug workaround or does it need to be called for any reason? I removed it (because that seems like the better alternative than adding a guard to viewWillAppear:) and everything works as expected now (work is not done twice).

    opened by nburatovich 1
  • Version 1.2.0

    Version 1.2.0

    Release 1.2.0

    • Lots of comments.
    • Remove dependency on pch file
    • Update Readme to include VC methods calls to super
    • Remove warning from Xcode 6.3 about `fabsf and fabs.
    opened by alexrrouse 1
  • Need latest swift support

    Need latest swift support

    We are using this library for custom View Controller transitions and it's really awesome and this library does not support lates swift version. Could you add support for latest swift version?

    opened by harikarthick 0
  • Layout not respected in destination view controller

    Layout not respected in destination view controller

    Hi! First, great work with this library! I'm using it in a Swift project, but I'm having problems with the layout of the destination view controller that is not respected. I've added this line in my AppDelegate : RZTransitionsManager.shared().defaultPushPopAnimationController = RZZoomPushAnimationController() And this in my ToViewController : self.navigationController?.delegate = RZTransitionsManager.shared()

    The transition is working very good, but in my DestinationViewController the layout isn't respected because some labels are put behind the navigation bar (which has the translucent property set to false). How can I solve this?

    opened by andrealufino 0
  • [Question] Implement RZTransitionInteractionController inside each view controller to make transition interactive?

    [Question] Implement RZTransitionInteractionController inside each view controller to make transition interactive?

    On application launch I set the default animation controllers for RZTransitionsManager:

    let manager = RZTransitionsManager.shared()
    manager.defaultPresentDismissAnimationController = RZZoomPushAnimationController()
    manager.defaultPushPopAnimationController = RZZoomPushAnimationController()
    

    Custom transition is working well when I push or pop the view controller inside of navigation stack. But transition is not interactive. Pan gesture from screen edge closes view controller immediately and it’s not possible to stop the transition.

    The question is: should I implement RZTransitionInteractionController inside each view controller to make transition interactive? Or, maybe, there’s an easier way?

    opened by Showtimes 1
  • fixes for https://github.com/Raizlabs/RZTransitions/issues/52

    fixes for https://github.com/Raizlabs/RZTransitions/issues/52

    Fixes for https://github.com/Raizlabs/RZTransitions/issues/52

    • Added toViewController.view.frame = [transitionContext finalFrameForViewController:toViewController]; to the end of the - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext methods (in each of the transitions) as per this SO.
    • Updated the project settings in the Demo to build with multiple orientations (as well as iPad) enabled for testing.
    opened by julianwyz 0
Releases(1.2.1)
Owner
Rightpoint
Rightpoint is an independent customer experience agency with technology at our core.
Rightpoint
An extensible iOS and OS X animation library, useful for physics-based interactions.

Pop is an extensible animation engine for iOS, tvOS, and OS X. In addition to basic static animations, it supports spring and decay dynamic animations

Meta Archive 19.8k Dec 28, 2022
(Animate CSS) animations for iOS. An easy to use library of iOS animations. As easy to use as an easy thing.

wobbly See Wobbly in action (examples) Add a drop of honey ?? to your project wobbly has a bunch of cool, fun, and easy to use iOS animations for you

Sagaya Abdulhafeez 150 Dec 23, 2021
(Animate CSS) animations for iOS. An easy to use library of iOS animations. As easy to use as an easy thing.

wobbly See Wobbly in action (examples) Add a drop of honey ?? to your project wobbly has a bunch of cool, fun, and easy to use iOS animations for you

Sagaya Abdulhafeez 150 Dec 23, 2021
A collection of animations for iOS. Simple, just add water animations.

DCAnimationKit A collection of animations for iOS Simply, just add water! DCAnimationKit is a category on UIView to make animations easy to perform. E

Dalton 797 Sep 23, 2022
Easily build advanced custom animations on iOS.

INTUAnimationEngine makes it easy to build advanced custom animations on iOS. INTUAnimationEngine provides a friendly interface to drive custom animat

Intuit 1.1k Dec 14, 2022
Ease is an event driven animation system that combines the observer pattern with custom spring animations as observers

Ease is an event driven animation system that combines the observer pattern with custom spring animations as observers. It's magic. Features Animate a

Robert-Hein Hooijmans 1.3k Nov 17, 2022
A UICollectionViewLayout subclass that adds custom transitions/animations to the UICollectionView without effecting your existing code.

AnimatedCollectionViewLayout Normally a UICollectionView has no transition effects when you scroll from one item to another. There are lots of ways to

Jin Wang 4.5k Jan 1, 2023
Custom MacBook keyboard backlight animations

KBPulse Pulse the backlight on your Mac keyboard Demo Configuration Configuration files (.json) are stored in ~/Documents/KBPulse. (This location will

Ethan Chaffin 10 Aug 11, 2022
An iOS library to natively render After Effects vector animations

Lottie for iOS, macOS (and Android and React Native) View documentation, FAQ, help, examples, and more at airbnb.io/lottie Lottie is a mobile library

Airbnb 23.6k Dec 31, 2022
A library to simplify iOS animations in Swift.

Updated for Swift 4.2 Requires Xcode 10 and Swift 4.2. Installation Drop in the Spring folder to your Xcode project (make sure to enable "Copy items i

Meng To 14k Jan 3, 2023
A library for fancy iOS animations that you will definitely love.

EazelAnimationsKit Table of Contents Introduction Animations Usage Installation Contribution Authors Introduction The drive for developing this animat

Eazel 7 Dec 13, 2022
Swift library for choreographing animations on the screen.

Spruce iOS Animation Library (and Android) What is it? Spruce is a lightweight animation library that helps choreograph the animations on the screen.

WillowTree, LLC 3.4k Jan 3, 2023
SamuraiTransition is an open source Swift based library providing a collection of ViewController transitions featuring a number of neat “cutting” animations.

SamuraiTransiton is a ViewController transition framework in Swift. It is an animation as if Samurai cut out the screen with a sword. transition types

hachinobu 273 Dec 29, 2022
Easy to read and write chainable animations in Objective-C and Swift

Whats new in version 3.x? Swiftier syntax Swift 4 support Bug fixes and improvements Whats new in version 2.x? Re-architected from the ground up, no m

Jeff Hurray 3.2k Dec 30, 2022
⛓ Easy to Read and Write Multi-chain Animations Lib in Objective-C and Swift.

中文介绍 This project is inspired by JHChainableAnimations! Why Choose LSAnimator & CoreAnimator? You can write complex and easy-to-maintain animations in

木子 1.6k Nov 22, 2022
Physics-based animations for iOS, tvOS, and macOS.

Advance An animation library for iOS, tvOS, and macOS that uses physics-based animations (including springs) to power interactions that move and respo

Tim Donnelly 4.5k Dec 29, 2022
This repo contains swift collection of gui, games, menu, animations, music, payment, etc... for iOS, macOS, watchOS and tvOS

Swift-Collections About: This repo contains a collection of projects built using swift and objective-c Contains projects for macOS iOS iPad watchOS tv

Krisna Pranav 6 Nov 15, 2022
ChainPageCollectionView A custom View with two level chained collection views and fancy transition animation

ChainPageCollectionView A custom View with two level chained collection views and fancy transition animation. Demo Requirements iOS 9.0+ Xcode 8 Insta

Yansong Li 775 Dec 7, 2022