我正在打印使用这两种触摸跟踪方法获得的点列表。
手势识别器更易于使用,但如果将获得的点与 touchesBegan 过程进行比较,识别器会避免一些点,特别是在 Action 开始时。
有人知道这两个程序在准确性方面是否存在差异吗?
谢谢!
最佳答案
我相信手势识别器最初需要一些时间来断言它已检测到正确的手势。 例如,如果我们执行滑动手势,ios 会首先等待确认这不是点击手势。
因此,手势识别器可能不会打印运动开始时的点。
如开发人员文档所述here :
Gesture recognizers may delay the delivery of touch objects to the view while they are recognizing gestures, and by default they cancel delivery of remaining touch objects to the view once they recognize their gesture.
可在 this link 找到有用的详细示例.
希望这对您有所帮助。
关于iphone - UIGestureRecognizers vs touchesBegan/touchesMoved/touchesEnded(准确性),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11851464/