Instance Method

canBePreventedByGestureRecognizer:

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

Declaration

- (BOOL)canBePreventedByGestureRecognizer:(UIGestureRecognizer *)preventingGestureRecognizer;

Parameters

preventingGestureRecognizer

An instance of a subclass of UIGestureRecognizer.

Return Value

YES to indicate that preventingGestureRecognizer can block the receiver from recognizing its gesture, otherwise NO.

Discussion

Overriding these methods enables the same behavior as implementing the UIGestureRecognizerDelegate methods gestureRecognizerShouldBegin: and gestureRecognizer:shouldReceiveTouch:. However, by overriding them, subclasses can define class-wide prevention rules. For example, a UITapGestureRecognizer object never prevents another UITapGestureRecognizer object with a higher tap count.

See Also

Methods for Subclasses

- touchesBegan:withEvent:

Sent to the gesture recognizer when one or more fingers touch down in the associated view.

- touchesMoved:withEvent:

Sent to the gesture recognizer when one or more fingers move in the associated view.

- touchesEnded:withEvent:

Sent to the gesture recognizer when one or more fingers lift from the associated view.

- touchesCancelled:withEvent:

Sent to the gesture recognizer when a system event (such as an incoming phone call) cancels a touch event.

- touchesEstimatedPropertiesUpdated:

Sent to the gesture recognizer when the estimated properties for a touch have changed so that they are no longer estimated, or an update is no longer expected.

- reset

Overridden to reset internal state when a gesture recognition attempt completes.

- ignoreTouch:forEvent:

Tells the gesture recognizer to ignore a specific touch of the given event.

- canPreventGestureRecognizer:

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

- shouldRequireFailureOfGestureRecognizer:

Overridden to indicate that the receiver requires the specified gesture recognizer to fail.

- shouldBeRequiredToFailByGestureRecognizer:

Overridden to indicate that the receiver should be required to fail by the specified gesture recognizer.

- ignorePress:forEvent:

Tells the gesture recognizer to ignore a specific press of the given event.

- pressesBegan:withEvent:

Sent to the receiver when a physical button is pressed in the associated view.

- pressesChanged:withEvent:

Sent to the receiver when the force of the press has changed in the associated view.

- pressesEnded:withEvent:

Sent to the receiver when a button is released from the associated view.

- pressesCancelled:withEvent:

Sent to the receiver when a system event (such as a low-memory warning) cancels a press event.