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 p
(Swift 3) Pass .allowUserInteraction option
UIView.animate(withDuration: 0.75, delay: 0.0, options: [.allowUserInteraction], animations: {
// Desired animation(s)
}, completion: { (finished: Bool) in
// Completion
})
I'm assuming that you are using the [UIView animateWithDuration: delay: options: animations: completion:];
method of animating.
If so, you need to pass UIViewAnimationOptionAllowUserInteraction
as an option to get the animated view to respond to touches while it is animating.
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.