Instance Method

gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:

Asks the delegate if two gesture recognizers should be allowed to recognize gestures simultaneously.

Declaration

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(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 allow both gestureRecognizer and otherGestureRecognizer to recognize their gestures simultaneously. The default implementation returns NO—no two gestures can be recognized simultaneously.

Discussion

This method is called when recognition of a gesture by either gestureRecognizer or otherGestureRecognizer would block the other gesture recognizer from recognizing its gesture. Note that returning YES is guaranteed to allow simultaneous recognition; returning NO, on the other hand, is not guaranteed to prevent simultaneous recognition because the other gesture recognizer's delegate may return YES.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software