views:

8

answers:

1

I'm trying to change the way a UIWebView reacts when the user do a pinch out gesture (when he's doing that, I zoom out and show multiple webView).

I see 2 solutions but I can't make them work :

  1. Setting scalesPageToFit to YES, and then getting events that are sent by the API to change the behavior. Problem: I don't find how to catch those events
  2. Setting scalesPageToFit to NO, and adding a PinchGestureRecognizer on the parent of the UIWebView. Problem: The gesture is not well recognize since there are conflicts with the scrolling. If the user starts moving the first finger before putting down the second finger, the scroll begin and the pinchGesture is not recognize.

Do you have an idea ?

A: 

Ok, the anwser is just to set the delegate of my UIPinchGestureRecognizer to self and to override

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)recognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer*) otherRecognizer 
{
  return YES;
}

Now the pinch is recognized even if the scroll began in the UIWebView

CedricSoubrie