UIGestureRecognizerDelegate
gestureRecognizer:shouldReceiveTouch:
Asks the delegate if a gesture recognizer should receive an object representing a touch.
gestureRecognizer:shouldReceivePress:
Asks the delegate if a gesture recognizer should receive an object representing a press.
gestureRecognizerShouldBegin:
Asks the delegate if a gesture recognizer should begin interpreting touches.
gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:
This method is called when recognition of a gesture by either
gestureRecognizer
orotherGestureRecognizer
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 returnYES
.
gestureRecognizer
An instance of a subclass of the abstract base class
UIGestureRecognizer
. This is the object sending the message to the delegate.能保证别人可以参与到自己的识别,不能保证自己不参与到别人的识别
互相返回NO,可以保证互相不干扰