自定义UIStoryboardSegue Push和Pop匹配动画

Ana*_*Ana 9 ios uistoryboardsegue

我有一个以下代码UIStoryBoardSegue来做一个卷曲推送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];

}
Run Code Online (Sandbox Code Playgroud)

它工作正常,但是当我点击应用程序上的"后退"按钮时,它会向后滑动而不是向下滑动.因为这是推送,我需要弹出当前的视图控制器而不是添加另一个segue.

我如何做一个"卷曲的流行音乐"?

b12*_*400 0

我在 SO 上发现了这个问题,这可能对您有帮助:Reversal of Custom Segue with Storyboarding

但这可能不是一个完美的解决方案。