How to animate (move) a UIButton while keeping it palpable while moving?

It seems that when you animate UIButton, the real button is always in the destination position. Animation is just a "movie." In this code, while in animation, a button only receives an event if I touch an empty final destination (centered at 600x900). If I touch it, as I see it in the display position, that is, at some point when the button is drawn (in the middle of the animation) nothing happens.

CGPoint point;
point.x = 600;
point.y = 900;
[UIView animateWithDuration:16 
        delay:0 
        options:(UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionAllowAnimatedContent)
        animations:^{

            [movingbutton setCenter:point];
        }
        completion:^(BOOL finished){
            NSLog(@"animation completed");
        }
];

It is impossible to figure out how to make the animation button nice in the right way of the animation. Any ideas? Thanx!

+3
source share
1 answer

NSTimer ( ) .

?

+2

Source: https://habr.com/ru/post/1780078/


All Articles