Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
为什么'touches'不仅仅是'touch'被传递给touchesBegan/Moved/Ended?
它们的意义是什么?
这是因为用户可能会(快速)进行多次点击,在这种情况下,您将收到一组多个NSTouch对象。
NSTouch
双击滚动(或图像)视图时的缩放效果就是一个演示。
因为您可以接收多个触摸,但默认情况下它们是禁用的。为了接收多个触摸事件,您必须将multipleTouchEnabled相应视图实例的属性设置为YES并使用 2 个或更多手指进行触摸。
multipleTouchEnabled
YES