Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

animateKeyframesWithDuration make screen Not responding after animation

I use animateKeyframesWithDuration to simple animate my view:

[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) {
    
}];

After the animation finished (completion block called with finished = YES), the UIViewController isn't responsive, e.g. I can't press any UIButton on top the UIViewController.

Why that?

like image 737
gran33 Avatar asked Oct 21 '22 08:10

gran33


1 Answers

I added this line in the completion block:

[transitionContext completeTransition:NO];

That fix my problem.

like image 130
gran33 Avatar answered Oct 29 '22 19:10

gran33