Difference between "(NSSet *)touches" and "event.allTouches" in "touchesBegan:withEvent:"
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?
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 and event.allTouches
is described here ;)
精彩评论