【发布时间】:2020-11-21 21:06:42
【问题描述】:
我想从 UILongPressGuestureRecognizer 中获取多个多次触摸的位置,其中所需的触摸次数不止一个。我知道我可以执行以下操作来获取使用一根手指时的位置。
let twoFingerLongPressGesture = UILongPressGestureRecognizer(target: self, action: #selector(twoFingerLongPressChordTouchView(gesture:)))
twoFingerLongPressGesture.numberOfTouchesRequired = 2
twoFingerLongPressGesture.minimumPressDuration = 0.02
self.addGestureRecognizer(twoFingerLongPressGesture)
@objc func twoFingerLongPressAction(gesture: UILongPressGestureRecognizer) {
let location = gesture.location(in: self)
}
我也知道我可以在触摸开始回调中迭代触摸,但是我正在尝试利用 UILongPressGestureRecognizer 中的特定行为。提前感谢您的任何帮助或建议!!!
【问题讨论】:
标签: swift location touches uilongpressgesturerecogni