Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIViewAnimation blocks user interaction

I have a UIView following the users finger as they move it around inside my app. Sometimes, other things on screen are animating with UIViewAnimation blocks, but this freezes the tracking of their finger, so if they continue moving their finger during the animation, it won't follow. How can i stop the animation from blocking up the main thread?

like image 730
Andrew Avatar asked Dec 21 '22 11:12

Andrew


2 Answers

Try using UIViewAnimationOptionAllowUserInteraction with [UIView animateWithDuration:delay:options:animations:completion:]

like image 102
Stefan Avatar answered Jan 07 '23 22:01

Stefan


you can use the NSObject's method: performSelector:onThread:withObject:waitUntilDone:

More details in Apple NSObject Documentation

like image 39
teriiehina Avatar answered Jan 07 '23 22:01

teriiehina