Search code examples
iphonecocoa-touchuigesturerecognizerpinch

UIPinchGestureRecognizer's touch locations


I want to implement zooming with pinch gesture in my iphone app. The problem is, in a method that gets called when the gesture is recognized I don't have access to the touch events themselves (so I can't really get their locationInView:) and I would like to get it in order to center my zoom-in properly.

In the UIPinchGestureRecognizer class definition there is a UITouch *_touches[2]; defined, but I can't access it from outside of the class. Is there anything I can do in order to get that data?


Solution

  • Hope this helps UIPinchGestureRecognizer position the pinched view between the two fingers