Called when the recognition of one of Gesturerecognizer or Othergesturerecognizer would is blocked by the other
Return YES to allow both to recognize simultaneously. The default implementation returns no (by default No. Gestures can be recognized simultaneously)
That means, return yes, allow both to handle gesture interaction, (if it is webview, you can add a click gesture, but do not affect the webview scrolling gesture), return no, do not accept external gestures
//
Note:returning YES guaranteed to allow simultaneous recognition. Returning guaranteed to prevent simultaneous recognition, as the other gesture ' s delegate may return YES
-(BOOL) Gesturerecognizer: (Uigesturerecognizer *) Gesturerecognizer Shouldrecognizesimultaneouslywithgesturerecognizer: (Uigesturerecognizer *) Othergesturerecognizer;
* * Example
Nsurl *url = [Nsurl Urlwithstring:urlarray[idx]]; Nsurlrequest *request = [Nsurlrequest requestwithurl:url]; [WebView loadrequest:request]; webview.userinteractionenabled = YES; UITapGestureRecognizer *singletap = [[UITapGestureRecognizer alloc] initwithtarget:self action: @selector ( Handlewebview:)]; Singletap.delegate= self; Singletap.cancelstouchesinview =no;
-(BOOL) Gesturerecognizer: (Uigesturerecognizer *) Gesturerecognizer Shouldrecognizesimultaneouslywithgesturerecognizer: (Uigesturerecognizer *) othergesturerecognizer{
return Yes;//Returns the gesture on the Yes,webview function.
return no; Returns no, or does not call this method the gesture on WebView does not work.
}
Gesture-webview and scrollview repetitive gesture processing