Instance Method

canPreventGestureRecognizer:

Overridden to indicate that the current object can prevent the specified gesture recognizer from recognizing its gesture.

Declaration

- (BOOL)canPreventGestureRecognizer:(NSGestureRecognizer *)preventedGestureRecognizer;

Parameters

preventedGestureRecognizer

The gesture recognizer to be prevented from recognizing its gesture.

Return Value

YES to indicate that preventedGestureRecognizer should be blocked from recognizing its gesture, or NO if both gesture recognizers can operate simultaneously.

Discussion

This method enables similar behavior as the gestureRecognizerShouldBegin: and gestureRecognizer:shouldRequireFailureOfGestureRecognizer: methods of the gesture recognizer’s delegate. Using this method lets you define rules that apply to all instances of your custom gesture recognizer class. For example, an NSClickGestureRecognizer object does not prevent another NSClickGestureRecognizer object with a higher click count from recognizing its gesture.

See Also

Methods for Subclasses

- reset

Overridden to reset the internal state of the gesture recognizer when an attempt completes.

- mouseDown:

Informs the gesture recognizer that the user pressed the left mouse button.

- mouseDragged:

Informs the gesture recognizer that the user moved the mouse with the left button pressed.

- mouseUp:

Informs the gesture recognizer that the user released the left mouse button.

- otherMouseDown:

Informs the gesture recognizer that the user pressed a mouse button other than the left or right one.

- otherMouseDragged:

Informs the gesture recognizer that the user moved the mouse with a button other than the left or right one pressed.

- otherMouseUp:

Informs the gesture recognizer that the user released a mouse button other than the left or right one.

- rightMouseDown:

Informs the gesture recognizer that the user pressed the right mouse button.

- rightMouseDragged:

Informs the gesture recognizer that the user moved the mouse with the right button pressed.

- rightMouseUp:

Informs the gesture recognizer that the user released the right mouse button.

- magnifyWithEvent:

Informs the gesture recognizer that the user is performing a pinch gesture.

- rotateWithEvent:

Informs the gesture recognizer that the user is performing a rotation gesture.

- canBePreventedByGestureRecognizer:

Overridden to indicate that the specified gesture recognizer can prevent the current object from recognizing a gesture.

- shouldBeRequiredToFailByGestureRecognizer:

Overridden to indicate that the current object must fail before the specified gesture recognizer begins recognizing its gesture.

- shouldRequireFailureOfGestureRecognizer:

Overridden to indicate that the specified gesture recognizer must fail before the current object begins recognizing its gesture.

- keyDown:

Informs the gesture recognizer that the user has pressed a key.

- keyUp:

Informs the gesture recognizer that the user released a key.

- tabletPoint:

Informs the user that a tablet-point event occurred.

- flagsChanged:

Informs the current object that the user pressed or released a modifier key (Shift, Control, and so on).

- pressureChangeWithEvent:

Informs the current object that a pressure change occurred on a system that supports pressure sensitivity.