I must rotate an image but I can't use the gestures or the slider, so I have thinked about using 2 buttons, one for clockwise rotation and the other for couterclockwise rotation of my UIImageView.
But I'm getting notified only one time for touch down event so my image rotate only one time.
There is a way to get continous touch down event when I press my button?
Is there isn't such opportunity, how can I implement this contino开发者_JS百科us rotation with the two buttons?
Sorry if I've said something wrong I'm new to iOS development.
There's a couple of ways you could do this - UIButtons have touchDown
and touchUp
events, so you could start a process on touchDown
and end it on touchUpInside
. This discussion might be useful.
Alternatively, rather than using UIbuttons you might want to try detecting a touchesBegan
in a particular area (say on a UIImageView containing a button-lie image), then running the rotation animation until the touchesEnded
event occurs?
精彩评论