0

touching a UIButton rapidly does not deliver all touches up to the receiver.

Is there any recourse?

iOS 12 in case that matters. both real device and simulator

Anton Tropashko
  • 5,486
  • 5
  • 41
  • 66

1 Answers1

0

I was animating touches in the handler for that touch up:

        // https://stackoverflow.com/questions/46021640/how-to-sequence-two-animations-with-delay-in-between
        let scaleForwardAnimationDuration: TimeInterval = 0.15
        let transformBackAnimationDuration: TimeInterval = 0.1
        let animationDuration: TimeInterval = scaleForwardAnimationDuration + transformBackAnimationDuration

        UIView.animateKeyframes(withDuration: animationDuration, delay: 0, options: [], animations: {
            UIView.addKeyframe(withRelativeStartTime: 0, relativeDuration: scaleForwardAnimationDuration) {
                sender.transform = CGAffineTransform(scaleX: 0.75, y: 0.75)
            }

            UIView.addKeyframe(withRelativeStartTime: scaleForwardAnimationDuration, relativeDuration: transformBackAnimationDuration) {
                sender.transform = .identity
            }
        })

and that caused input dropped on the floor due to .allowUserInteraction absent from options of the outer animation block

Anton Tropashko
  • 5,486
  • 5
  • 41
  • 66