I did not want to initially do it this way, but it seems to work without problems so far (taken from devforums post):
Add a UIGestureRecognizerDelegate to your header. Now add a version number check ... If we are on iOS 4, we can do this:
if (NSFoundationVersionNumber >= 678.58){ UIPinchGestureRecognizer *pinch = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinchGestureCaptured:)]; pinch.delegate = self; [mapView addGestureRecognizer:pinch]; [pinch release]; UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureCaptured:)]; pan.delegate = self; [mapView addGestureRecognizer:pan]; [pan release]; }
Add delegate methods to handle gestures:
#pragma mark - #pragma mark Gesture Recognizers - (void)pinchGestureCaptured:(UIPinchGestureRecognizer*)gesture{ if(UIGestureRecognizerStateEnded == gesture.state){
source share