IOS中的UILongPressGestureRecognizer 13秒在MKMapView上长按两次无法正常工作

问题描述

我已经设置了一个UILongPressGestureRecognizer,它在IOS 13之前的版本中可以正常工作,但是在此版本中,要检测第二次长按,我必须按两次。

也就是说:

1ºLongPress->精细播放“长按”

2ºLongPress->不起作用

3ºLongPress->精细播放“长按”

4ºLongPress->不起作用

...

这是我的代码

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

调用函数是:

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

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)