iOS - animateKeyframesWithDuration make screen动画后没有响应

gra*_*n33 5 uiview uiviewanimation ios

我用animateKeyframesWithDuration简单的动画来查看我的视图:

[UIView animateKeyframesWithDuration:1.0 delay:0.0 options:0 animations:^{
    [UIView addKeyframeWithRelativeStartTime:0.0 relativeDuration:0.5 animations:^{
        containerView.center = CGPointMake(containerView.center.x, 150);
    }];
    [UIView addKeyframeWithRelativeStartTime:0.5 relativeDuration:0.5 animations:^{
        containerView.center = oldCenter;

    }];

}completion:^(BOOL finished) {

}];
Run Code Online (Sandbox Code Playgroud)

动画结束后(完成块调用finished = YES),UIViewController没有响应,例如我不能按任何UIButton顶部的UIViewController.

为什么?

10x提前!

gra*_*n33 3

我在完成块中添加了这一行:

[transitionContext completeTransition:NO];
Run Code Online (Sandbox Code Playgroud)

这解决了我的问题。