Giter Club home page Giter Club logo

portaltransition's Introduction

Portal Transition

Build Status

Inspired by Apple's keynote portal animation, it is an iOS implementation of Portal like UIViewController transition.

Portrait:

Landscape:

Requirements

PortalTransition supports iOS 7.0 and later,

Dependencies:

  • CoreGraphics.framework
  • QuartzCore.framework

Usage

Copy PortalTransition folder to your project

Present a UIViewController

Set a viewControllerTransitionDelegate

#import "CYViewControllerTransitioningDelegate.h"

@interface ViewController ()

@property (nonatomic, strong) CYViewControllerTransitioningDelegate *viewControllerTransitionDelegate;

@end


// Instatiate transitionDelegate
self.viewControllerTransitionDelegate = [CYViewControllerTransitioningDelegate new];

NewViewController *newVC = [NewViewController new];
newVC.modalPresentationStyle = UIModalPresentationCustom;
// Set the presentedViewController to delegate's viewController, it will implemente delegate methods for you
self.viewControllerTransitionDelegate.viewController = newVC;
// Just push your viewController
[self presentViewController:newVC animated:YES completion:nil];

Use custom category methods

#import "UIViewController+PortalTransition.h"

// Just call the custom present method
[self presentPortalTransitionViewController:newVC completion:nil];

Push a UIViewController to your UINavigationController's viewcontroller stack

Set a viewControllerTransitionDelegate

#import "CYNavigationControllerDelegate.h"

@interface ViewController ()

@property (nonatomic, strong) CYNavigationControllerDelegate *navDelegate;

@end


// Instatiate transitionDelegate
self.navDelegate = [CYNavigationControllerDelegate new];

NewViewController *newVC = [NewViewController new];
// Set your navigation controller to your navDelegate
self.navDelegate.navController = self.navigationController;
[self presentViewController:newVC animated:YES completion:nil];

Use custom category method

#import "UINavigationController+PortalTransition.h""

// Just call the custom present method
[self.navigationController pushPortalTransitionViewController:vc completion:nil];

Custom animator parameters configuration

/**
*  Gap between the target view and reflection, default is 8.0
*/
@property (nonatomic, assign) CGFloat reflectionGap;


/**
*  ReflectionHeight / targetViewHeight, default is 0.5
*/
@property (nonatomic, assign) CGFloat reflectionScale;

/**
*  Opacity of reflectionView, default is 0.5
*/
@property (nonatomic, assign) CGFloat reflectionAlpha;

/**
*  Target view size / origin view size, default is 0.5
*/
@property (nonatomic, assign) CGFloat targetViewScale;

/**
*  Portal animation duration, default is 2.0
*/
@property (nonatomic, assign) CGFloat portalAnimationDuration;

/**
*  Animation duration, default is 3.O
*/
@property (nonatomic, assign) CGFloat scaleAnimationDuration;

/**
*  Target view scale animation delay after portal animation, default is 0.5
*/
@property (nonatomic, assign) CGFloat delay;

/**
*  UIViewController Transition Style, support UINavigationViewController Push, UIViewController present
*/
@property (nonatomic, assign) CYPortalTransitionStyle portalTransitionStyle;

TODO

  • Implemente interactive transition for pop & dismiss view controller
  • Cocoapods
  • Unit Test

portaltransition's People

Contributors

machackx avatar

Watchers

Carabineiro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.