Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to recognize tap gesture while a view is animating

Just wondering is there way to have a view recognize tap gestures while it is being animated? I am working on a view that has a cashapelayer line tethered to it. When the user pans the view (pan gesture) the line follows accordingly until the user stops panning. At this point an animation is executed that brings the view back to its original position and the tether layer back as well. Now my only real problem is that while the view and the tether are animating the view doesnt respond to tap gestures…

Anyone know some tricks? I hope my explanation was understandable and thanks in advance!

(if the tethered view concept is not clear there is a free app called discovr apps which will give an example).

like image 741
johnnyd Avatar asked Sep 07 '11 16:09

johnnyd


1 Answers

You need to set two options - UIViewAnimationOptionAllowUserInteraction and UIViewAnimationOptionAllowAnimatedContent. First lets you interact with views during animation, second forces to redraw views on every frame of animation and not use snapshots of beginning and ending frames.

like image 172
Kyr Dunenkoff Avatar answered Nov 18 '22 13:11

Kyr Dunenkoff