Protocol: UIGestureRecognizerDelegate
Overview
Delegates of a gesture recognizer—that is, an instance of a concrete subclass of UIGestureRecognizer—adopt the UIGestureRecognizerDelegate protocol to fine-tune an application’s gesture-recognition behavior. They receive messages from the gesture recognizer, and their responses to these messages enable them to affect the operation of the gesture recognizer or permit the simultaneous operation of two gesture recognizers.Ask the delegate if a gesture recognizer should receive an object representing a touch.Asks the delegate if two gesture recognizers should be allowed to recognize gestures simultaneously.Asks the delegate if a gesture recognizer should begin interpreting touches.
Instance Method Summary (collapse)
-
- gestureRecognizer:shouldReceiveTouch:
Ask the delegate if a gesture recognizer should receive an object representing a touch.
-
- gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:
Asks the delegate if two gesture recognizers should be allowed to recognize gestures simultaneously.
-
- gestureRecognizerShouldBegin:
Asks the delegate if a gesture recognizer should begin interpreting touches.
Instance Method Details
- (Boolean) gestureRecognizer(gestureRecognizer, shouldReceiveTouch:touch)
Ask the delegate if a gesture recognizer should receive an object representing a touch. This method is called before touchesBegan:withEvent: is called on the gesture recognizer for a new touch.
- (Boolean) gestureRecognizer(gestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer:otherGestureRecognizer)
Asks the delegate if two gesture recognizers should be allowed to recognize gestures simultaneously. 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.
- (Boolean) gestureRecognizerShouldBegin(gestureRecognizer)
Asks the delegate if a gesture recognizer should begin interpreting touches. This method is called when a gesture recognizer attempts to transition out of the UIGestureRecognizerStatePossible state. Returning NO causes the gesture recognizer to transition to the UIGestureRecognizerStateFailed state.