Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom UIStoryboardSegue Push and Pop matching animations

I have the following code in a UIStoryBoardSegue to do a curl-up push segue.

 (void) perform {

    UIViewController *src = (UIViewController *) self.sourceViewController;
    UIViewController *dst = (UIViewController *) self.destinationViewController;

    [UIView transitionWithView:src.navigationController.view duration:1
                       options:UIViewAnimationOptionCurveEaseInOut | UIViewAnimationOptionTransitionCurlUp
                    animations:^{
                        [src.navigationController pushViewController:dst animated:NO];
                    }
                    completion:NULL];

}

It works fine, but when I tap on the "back" buttons on the app, it slides backwards instead of curling down. Because this is a push, I need to pop the current view controller instead of adding another segue.

How do I do a "curl-down pop segue" ?

like image 622
Ana Avatar asked Jul 01 '12 16:07

Ana


1 Answers

For anyone following this now, iOS 7 lets you animate both ways:

Set the segue to Push, then see code below for a push implementation.

https://github.com/Dzamir/OldStyleNavigationControllerAnimatedTransition

like image 105
Matt Avatar answered Oct 31 '22 11:10

Matt