문제

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?

도움이 되었습니까?

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top