Last Updated: February 25, 2016
·
1.623K
· supremegravity

Change transition between UIViewControllers

Inside a UIViewController

transition = CATransition.animation
transition.timingFunction = CAMediaTimingFunction.functionWithName( KCAMediaTimingFunctionEaseIn)
transition.duration = 0.25
transition.type = KCATransitionMoveIn #Push Reveal
transition.subtype = KCATransitionFromRight
self.navigationController.view.layer.removeAllAnimations
self.navigationController.view.layer.addAnimation(transition, forKey:KCATransition)
 vc=UIViewController.alloc.init
 self.navigationController.pushViewController(vc, animated:false)

Types

kCATransitionFade
kCATransitionMoveIn
kCATransitionPush
kCATransitionReveal

[http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Reference/CATransition_Class/Introduction/Introduction.html#//apple_ref/doc/constant_group/Common_Transition_Types]

Subtypes

kCATransitionFromRight
kCATransitionFromLeft
kCATransitionFromTop
kCATransitionFromBottom

[http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Reference/CATransition_Class/Introduction/Introduction.html#//apple_ref/doc/constant_group/Common_Transition_Subtypes]