Contents

UILongPressGestureRecognizer

A continuous gesture recognizer that interprets long-press gestures.

Declaration

@MainActor class UILongPressGestureRecognizer

Overview

UILongPressGestureRecognizer is a concrete subclass of UIGestureRecognizer.

The user must press one or more fingers on a view and hold them there for a minimum period of time before the action triggers. While down, the userʼs fingers canʼt move more than a specified distance or the gesture fails.

A long-press gesture is continuous. The gesture begins (UIGestureRecognizer.State.began) when the user presses the number of allowable fingers (numberOfTouchesRequired) for the specified period (minimumPressDuration) and the touches don’t move beyond the allowable range of movement (allowableMovement). The gesture recognizer transitions to the Change state whenever a finger moves, and it ends (UIGestureRecognizer.State.ended) when the user lifts any of the fingers.

Topics

Configuring the gesture recognizer

See Also

Standard gestures