Programmatic Labels Lose Tap With Animations

I don't understand why my animations seem to override my user interaction when I try to tap on a label. What am I missing?

Code Block
  let tapGestureR = UITapGestureRecognizer(target: self, action: #selector(self.tapRev))
    revLabel.addGestureRecognizer(tapGestureR)
    let tapGestureP = UITapGestureRecognizer(target: self, action: #selector(self.tapPro))
    proLabel.addGestureRecognizer(tapGestureP)

Which animation ? The one of the other post ?
Your posts should be self content, not assume we have read all of your posts.

This is not a question or programmatic gesture, it is more general.

That's normal behaviour, see this:
https://stackoverflow.com/questions/35998808/tap-gesture-on-animating-uiview-not-working

You need to turn around it with touchesBegan call…


Did you make it work with touches ?

The problem is that during animation the systems "hides" the label and replaces by animated image. You thus tap on something which is not the label, but just an animated image of it ! As soon as animation ends, the original label is again visible and gesture works again.

With touches, you detect tap on some area of the screen, not linked to the label itself. Hence not disturbed by the animation.
Programmatic Labels Lose Tap With Animations
 
 
Q