views:

40

answers:

1

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, even while it is still touching the screen.

A: 

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.

unforgiven