Search code examples
iosuistoryboardsegue

Dropdown and bounce Segue anitimation


I am trying to replicate the following segue animation as seen in Secret where it bounces on the bottom of the screen. I have searched the internet but can't find anything to help me.

enter image description here

I am looking for the segue animation to dropdown from the top and bounce on the bottom of the screen.

Currently I have this but it doesn't bounce.

- (void)perform {

    UIViewController *srcViewController = (UIViewController *) self.sourceViewController;
    UIViewController *destViewController = (UIViewController *) self.destinationViewController;

    CATransition *transition = [CATransition animation];
    transition.duration = 0.4;
    transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    transition.type = kCATransitionMoveIn;
    transition.subtype = kCATransitionFromBottom;
    [srcViewController.view.window.layer addAnimation:transition forKey:nil];

    [srcViewController presentViewController:destViewController animated:NO completion:nil];
}

If it helps I use the POP animation engine.


Solution

  • You need a custom transition using UIKit Dynamics to perform the animation.