开发者

Is there a way to detect non-movement (touch events)?

开发者 https://www.devze.com 2022-12-29 22:06 出处:网络
Is there a way to detect a finger\'s non-movement by using a combination of UITouch events? The event methods touchesEnded and touchesCancelled are only fired when the event is cancelled or the finger

Is there a way to detect a finger's non-movement by using a combination of UITouch events? The event methods touchesEnded and touchesCancelled are only fired when the event is cancelled or the finger lifted. I would like to know when a touch has stopped moving,开发者_JAVA百科 even while it is still touching the screen.


Simply use the following UITouch property:

UITouchPhase phase;

if its value is UITouchPhaseStationary, then the finger has not moved on the screen since the last event received. This implies that you get the related touch in

touchesBegan:withEvent:

and then the user simply does not move his/her finger.

0

精彩评论

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