Instance Method

touchesMatchingPhase:inView:

Returns all the NSTouch objects associated with a specific phase.

Declaration

- (NSSet<NSTouch *> *)touchesMatchingPhase:(NSTouchPhase)phase inView:(NSView *)view;

Parameters

phase

The touch phase for which you want touches.

view

The view for which touches are wanted. Touches that target this view, or any of the view’s descendants will be returned. Passing nil as the view gets all touches regardless of their targeted view.

Return Value

A set of applicable NSTouch objects.

Discussion

This method is only valid for gesture events (gesture, magnify, swipe, rotate, etc.). Using this method a view can get all of the touches associated with a gesture without overriding the individual touch responder methods.

See Also

Getting Touch and Gesture Information