iphoneuigesturerecognizerpinch

How can I find out when a pinch gesture is finished (UIGestureRecognizer)


I want to get a callback when my UIPinchGestureRecognizer finished a pinch-gesture. Moreover it would be great to know if the finished gesture was a zoom in or a zoom out.

Does anyone know a method to use? Or the approach to do?

Thanks!


Solution

  • Another approach instead of overriding touchesEnded:, is that you could just check the state of the gesture recognizer in your target handler method.

      -(void)handlePinchGesture:(UIGestureRecognizer*)gestureRecognizer {    
        if(UIGestureRecognizerStateEnded == [gestureRecognizer state]){
          // do something
        }
      }