UIGestureRecognizers与touchesBegan / touchesMoved / touchesEnded(准确性) [英] UIGestureRecognizers vs touchesBegan/touchesMoved/touchesEnded (accuracy)

查看:181
本文介绍了UIGestureRecognizers与touchesBegan / touchesMoved / touchesEnded(准确性)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用这两种触摸追踪方法打印得到的点数列表。

I was printing the list of points I get using this two methods of touch tracking.

手势识别器更易于使用,但如果你比较点数你通过touchesBegan程序,识别器避免一些点,特别是在动作开始时。

The gesture recognizers are easier to use, but if you compare the points you get with the touchesBegan procedure, recognizers avoid some points, specifically at the beginning of the motions.

有人知道这两个程序之间的准确性是否存在差异?

Does anybody know if there is a difference regarding accuracy between this two procedures?

谢谢!

推荐答案

我相信手势识别器最初需要一些时间断言它已检测到正确的手势。
例如,如果我们做一个轻扫手势,ios会先等待确认它不是一个轻击手势。

I believe gesture recognizers would need some time initially to assert that it has detected the correct gesture. For example, if we do a swipe gesture, ios would first wait to confirm that it was not a tap gesture.

因此,手势识别器可能不是在动作开始时打印点。

Hence, gesture recognizers may not be printing the points at the beginning of the motion.

如开发者文档中所述这里


手势识别器可能会在识别手势时延迟将触摸对象传送到
视图,并且默认情况下会取消
将剩余触摸对象传送到查看一旦他们认出
他们的手势。

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.

一个有用的详细示例可以在此链接

A helpful detailed example can be found at this link.

希望这会有所帮助。

这篇关于UIGestureRecognizers与touchesBegan / touchesMoved / touchesEnded(准确性)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆