As I am new to this field. I searched a lot over net but cant find anything relevant. I am trying for UIPinchGestureRecognizer where once the user Pinch horizontally view should scale only horizontally, similarly for vertical also and if user does it diagonally it should scale in both directions. Currently my view is scaling in both direction as I am doing

CGAffineTransform newTransform = CGAffineTransformScale(currentTransform, scale, scale);

[[(UIPinchGestureRecognizer*)sender view] setTransform:newTransform];

Please help me on same.

Thanks in advance..

有帮助吗?

解决方案

Subclass UIGestureRecognizer an implement:

– touchesBegan:withEvent:
– touchesMoved:withEvent:
– touchesEnded:withEvent:
– touchesCancelled:withEvent:

In these delegates to your custom code for touch gesture.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top