UILongPressGestureRecognizer in IOS 13 second long press two times on MKMapView not work

Viewed 116

I have set up a UILongPressGestureRecognizer that works fine in versions before IOS 13, but in this version to detect the second long press, I have to press twice.

That is to say:

1º LongPress -> Work Fine show "long tap"

2º LongPress -> Not work

3º LongPress -> Work Fine show "long tap"

4º LongPress -> Not work

...

This is my code.

    let longTapGesture = UILongPressGestureRecognizer(target: self, action: #selector(longTap))
    longTapGesture.delegate = self
    longTapGesture.numberOfTouchesRequired = 1
    longTapGesture.cancelsTouchesInView = false
    
    mapView.addGestureRecognizer(longTapGesture)

Function called is:

    @objc func longTap(sender: UIGestureRecognizer){
      print("long tap")
      .....
    }
0 Answers
Related