Instance Method

touchesMoved:withEvent:

Tells the responder when one or more touches associated with an event changed.

Declaration

- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event;

Parameters

touches

A set of UITouch instances that represent the touches whose values changed. These touches all belong to the specified event. For touches in a view, this set contains only one touch by default. To receive multiple touches, you must set the view's multipleTouchEnabled property to YES.

event

The event to which the touches belong.

Discussion

UIKit calls this method when the location or force of a touch changes. Many UIKit classes override this method and use it to handle the corresponding touch events. The default implementation of this method forwards the message up the responder chain. When creating your own subclasses, call super to forward any events that you do not handle yourself. For example,

[super touchesMoved:touches withEvent:event];

If you override this method without calling super (a common use pattern), you must also override the other methods for handling touch events, even if your implementations do nothing.

See Also

Responding to Touch Events

- touchesBegan:withEvent:

Tells this object that one or more new touches occurred in a view or window.

- touchesEnded:withEvent:

Tells the responder when one or more fingers are raised from a view or window.

- touchesCancelled:withEvent:

Tells the responder when a system event (such as a system alert) cancels a touch sequence.

- touchesEstimatedPropertiesUpdated:

Tells the responder that updated values were received for previously estimated properties or that an update is no longer expected.