开发者

How can I get notified with continous touch down events from my button instead only one?

开发者 https://www.devze.com 2023-04-11 23:17 出处:网络
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.

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消