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.
精彩评论