DianQK / TransitionTreasury

Easier way to push your viewController.
https://transitiontreasury.com
MIT License
2.09k stars 158 forks source link

Example of Elevate transition #24

Open NBibikov opened 8 years ago

NBibikov commented 8 years ago

Hello! Please help me understand elevate transition. I have vc with facebook button. And i want that after tap on button my first controller present second with elevate animation. And i don't understand how work "maskView: , to: " in parameters. Thanks

let mainStoryboard: UIStoryboard = UIStoryboard(name: kTimelineStoryboard, bundle: nil)
let destinationViewController = mainStoryboard.instantiateViewControllerWithIdentifier(kCustomNavController)
self.tr_presentViewController(destinationViewController, method: TRPresentTransitionMethod.Elevate(maskView: self.facebookLogin, to: CGPointZero), statusBarStyle: TRStatusBarStyle.LightContent, completion:
DianQK commented 8 years ago

Hi~ @NBibikov

About maskView, you can see http://transitiontreasury.com

Elevate
via DianQK

.Elevate(maskView: UIView, to: CGPoint)

section

the pink view is a maskView

NBibikov commented 8 years ago

can you help me understand how my code should look like? Now i use

self.tr_presentViewController(destinationViewController, method: TRPresentTransitionMethod.Elevate(maskView: self.addReviewButtonOutlet, to: UIScreen.mainScreen().tr_center), statusBarStyle: TRStatusBarStyle.LightContent, completion:nil)

But that doesn't make elevate animation

NBibikov commented 8 years ago

Can you provide exemple of .Elevate animation in this project - https://github.com/NBibikov/ElevateAnimationExemple

Thank you very much!