开发者

Need a UIButton to tell me continuously whether or not it is touched

There's probably something really obvious I'm missing, but no matter how I trawl the documentation & the blogs, I can't find a way to make a button report whether or not it is being touched, regardless of whether 开发者_JAVA百科the touch moves, etc. I have an up & down button, & I need to call the relevant method whenever there is a finger on it.

Many thanks,

Franklyn Weber


Add an action to the touch down event and you are being touched up until any of the touch up events are fired. If you need to be continuously called, use an NSTimer. Start the timer on touch down and then check to see if you are still down in the timer handler. If you are, do your thing and set another timer.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜