Frage

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

War es hilfreich?

Lösung

Subclass UIGestureRecognizer an implement:

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

In these delegates to your custom code for touch gesture.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top