Reputation:
I have a button and when the user touches down and holds a popup appears. However, when the user releases his thumb before the pop animation finishes I'd like the animation to stop where it is and autoreverse to the initial position. How can I accomplish this?
Currently I'm simply using UIView
s -animateWithDuration:animations:completion:
. Do I have to set the animations explicitly in this case?
I've already tried reading the current state from the presentationLayer
properties, but that somehow didn't work.
Upvotes: 2
Views: 229
Reputation: 15228
You can start the second animation using the UIViewAnimationOptionBeginFromCurrentState
option. This will stop the first animation if it's still running.
Upvotes: 1