2 Gesture recognizer:
UIPinchGestureRecognizer *twoFingerPinch =
[[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinch:)];
[croppper addGestureRecognizer:twoFingerPinch];
UIPanGestureRecognizer *PanRecognizer = [[[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)] autorelease];
[croppper addGestureRecognizer:PanRecognizer];
and:
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
return YES;
}
But pinch and pan at the same time is not working... often i can pinch because the pan recognizer is on.
regards
It doesn't look like you're setting the delegate for each gesture recognizer. gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:
is a delegate method, and so if the gesture recognizer has no delegate, this method won't be invoked.
As a result, the default return value will be NO
, and so the gestures won't be recognised simultaneously.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With