无需 UIEvent 即可获取所有触摸
我正在寻找一种方法来获取所有当前的触摸,即使没有发生任何事件。我知道 [UIEvent allTouches]
但我需要能够看到“这些是屏幕上的所有触摸”,即使它们都没有改变。看起来应该是可能的,因为 allTouches
可以访问尚未更新的触摸,因此手机正在跟踪它们。
I'm looking for a way to get all the current touches even if no event has occurred. I know about [UIEvent allTouches]
but I need to be able to see "these are all the touches on the screen" even if none of them has changed. It seems like it should be possible because allTouches
can access touches which haven't been updated, so the phone is tracking them.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
覆盖touchesBegan和touchesEnded,并将当前点与事件中的缓存点进行比较。
Override touchesBegan and touchesEnded, and compare the current point against the cached point from the event.
尝试 hitTest:withEvent 并使用 pointInside:withEvent 进行过滤。
Try hitTest:withEvent and filter with pointInside:withEvent.