Objective-C: get UITouch for which UIEvent was launched

I can not find anywhere in the documentation. When this message is called in my subclass of UIView:

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event

How can I get the touch for which this message was called?

On both NSSet and UIEvent, I can only get a set of touches, but not a unique identifier, so I can determine which sensor caused the message.

PS: why the hell do they send an NSSet of all touches, as well as being able to get the same set from[[event allTouches] anyObject]

+3
source share
1 answer

, . , touchesMoved:withEvent:, .

touches. , , , touches.anyObject, . , .

, event.allTouches, , . touches , event.allTouches , , .

UITouch. , iOS UITouch. , . , UITouch NSDictionary, , objc_setAssociatedObject.

+8

All Articles