Question

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..

Was it helpful?

Solution

Subclass UIGestureRecognizer an implement:

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

In these delegates to your custom code for touch gesture.

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