如何为UIViewController设置自定义解雇动画

时间:2016-02-11 09:36:50

标签: ios uiviewcontroller

我知道这就是你为模态故事板segue或presentViewController:animated:completion设置动画的方法:

- (id<UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source {
    return [[BounceAnimationController alloc] init];
}

但是你如何设置一个解雇视图控制器呢?

1 个答案:

答案 0 :(得分:0)

我去看了一下UIViewControllerTransitioningDelegate代码,发现这个方法做到了:

- (id<UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed {
    return [[MyAnimationController alloc] init];
}