Question

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?

Was it helpful?

OTHER TIPS

i did not find an easier way to do it:

You can create a custom UIPinchGestureRecognizer and have two properties for UITouches. Assign their values on touchesBegun and touchesMoved. Then just access those properties to find positions of touches

That is what I've done and it worked well. Hope it helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top