Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to recognize touch event while a UIButton is animating

I want to move a UIButton with animation, and while its moving if user touches it, I want recognized that event, but during animation UIButton doesn't sent any event.

Please solve my problem.

like image 914
Rais Avatar asked Jan 16 '23 08:01

Rais


1 Answers

Have you tried AllowUserInteraction option?

 [UIView animateWithDuration:5.0 
                       delay:0.0         
                     options:UIViewAnimationOptionAllowUserInteraction
                  animations:^{ // move the button }
                 completion:^(BOOL finished){}];
like image 133
danh Avatar answered Jan 26 '23 04:01

danh