Search code examples
iosswiftuitapgesturerecognizerios13

UITapGestureRecognizer's numberOfTouchesRequired behaviour on iOS 13


Using the following code, I intercept taps with 3 fingers:

let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector( // selector here))
tapRecognizer.numberOfTouchesRequired = 3
tapRecognizer.numberOfTapsRequired = 1
self.view.addGestureRecognizer(tapRecognizer)

The code works as expected on iOS 12. On iOS 13 though, the action is not called.

Removing this line:

tapRecognizer.numberOfTouchesRequired = 3

Makes the action get called when the screen is tapped with one finger, but that's not the behaviour I am looking for.

What should I change in order to make the action get called when the screen is tapped with 3 fingers on iOS 13?


Solution

  • iOS 13.1 was released today, which fixes the issue with numberOfTouchesRequired set to 3.