Pergunta

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

Foi útil?

Solução

Subclass UIGestureRecognizer an implement:

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

In these delegates to your custom code for touch gesture.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top