实际上UIGestureRecognizerDelegate这个Protocol有7个函数,公开的只有3个,我目前发现UIWebView系统有使用5个。
@protocol UIGestureRecognizerDelegatePrivate <UIGestureRecognizerDelegate>
@optional
- (BOOL)_gestureRecognizer:(id)arg1 canBePreventedByGestureRecognizer:(id)arg2;
- (BOOL)_gestureRecognizer:(id)arg1 canPreventGestureRecognizer:(id)arg2;
- (BOOL)_gestureRecognizer:(id)arg1 shouldReceiveTouch:(id)arg2;
- (BOOL)_gestureRecognizer:(id)arg1 shouldRecognizeSimultaneouslyWithGestureRecognizer:(id)arg2;
- (BOOL)_gestureRecognizerShouldBegin:(id)arg1;
- (BOOL)_gestureRecognizer:(id)arg1 shouldBeRequiredToFailByGestureRecognizer:(id)arg2;
- (BOOL)_gestureRecognizer:(id)arg1 shouldRequireFailureOfGestureRecognizer:(id)arg2;
@end
使用场景:
一个view上以及其superview和subviews上有很多个gestureRecognizers时,可以使用这两个函数做手势间的互斥。如函数名那般顾名思义,返回值为第一个?手势能否阻止或被阻止第二个手势的触发。