“(NSSet *)touches”和“(NSSet *)touches”之间的区别和“event.allTouches”在“touchesBegan:withEvent:”中
我需要移动、旋转和缩放 UIImageView 对象。在方法中...
touchesBegan(NSSet *)touches withEvent:(UIEvent *)event
我必须使用哪些接触?
(NSSet *)touches
或者
event.allTouches
换句话说,我的触摸在哪里?
I need to move, rotate and zoom an UIImageView object. In the method...
touchesBegan(NSSet *)touches withEvent:(UIEvent *)event
which touches do I have to use?
(NSSet *)touches
or
event.allTouches
In other words, where are my touches?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
作为参数传递的
touches
是您视图中的触摸。event.allTouches
包含事件的所有触摸,甚至是未在您的视图中启动的触摸。请随时阅读事件处理指南对于iOS,在Apple的文档中,用一些图片进行了解释,可能会帮助您更好地理解。
特别是 参数中的
touches
与event.allTouches
的区别是此处描述;)touches
passed as the parameter are the touches in your view.event.allTouches
contains all the touches of the event, even the one that didn't start in your view.Don't hesitate to read the Event Handling Guide for iOS in Apple's doc, it is explained with some pictures it will probably help you understand better.
Especially the difference between the
touches
in the parameters andevent.allTouches
is described here ;)