Touches have life cycles. Each touch can pass through any of five phases that represent the progress of the touch within an interface. These phases are as follows:
UITouchPhaseBegan—Starts when users touch the screen.
UITouchPhaseMoved—Means a touch has moved on the screen.
UITouchPhaseStationary—Indicates that a touch remains on the screen surface but that there has not been any movement since the previous event.
UITouchPhaseEnded—Gets triggered when the touch is pulled away from the screen.
UITouchPhaseCancelled—Occurs when the iPhone OS system stops tracking a particular touch.This usually occurs due to a system interruption, such as when the application is no longer active or the view is removed from the window.
Predefined callback methods handle the start, movement, and release of touches from the screen. Corresponding to the phases you’ve already seen, the methods involved are as follows. Notice that UITouchPhaseStationary does not generate a callback.
touchesBegan:withEvent:—Gets called at the starting phase of the event, as the user starts touching the screen.
touchesMoved:withEvent:—Handles the movement of the fingers over time.
touchesEnded:withEvent:—Concludes the touch process, where the finger or fingers are released. It provides an opportune time to clean up any work that was handled during the movement sequence.
touchesCancelled:WithEvent:—Called when Cocoa Touch must respond to a system interruption of the ongoing touch event.