Instance Method

gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:

Asks the delegate if a gesture recognizer should be required to fail by another gesture recognizer.

Declaration

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;

Parameters

gestureRecognizer

An instance of a subclass of the abstract base class UIGestureRecognizer. This is the object sending the message to the delegate.

otherGestureRecognizer

An instance of a subclass of the abstract base class UIGestureRecognizer.

Return Value

YES to set up a dynamic failure requirement between gestureRecognizer and otherGestureRecognizer. The default implementation returns NOgestureRecognizer isn’t required to fail by otherGestureRecognizer.

Discussion

This method is called once per attempt to recognize, so failure requirements can be determined lazily and may be set up between recognizers across view hierarchies. Note that returning YES is guaranteed to set up the failure requirement; returning NO, on the other hand, isn’t guaranteed to prevent or remove a failure requirement because otherGestureRecognizer might make itself a failure requirement by using its own subclass or delegate methods.

See Also

Setting Up Failure Requirements

gestureRecognizer:shouldRequireFailureOfGestureRecognizer:

Asks the delegate if a gesture recognizer should require another gesture recognizer to fail.