Class

UILongPressGestureRecognizer

A discrete gesture recognizer that interprets long-press gestures.

Declaration

@interface UILongPressGestureRecognizer : UIGestureRecognizer

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.

Long-press gestures are continuous. The gesture begins (UIGestureRecognizerStateBegan) when the user presses the number of allowable fingers (numberOfTouchesRequired) for the specified period (minimumPressDuration) and the touches do not move beyond the allowable range of movement (allowableMovement). The gesture recognizer transitions to the Change state whenever a finger moves, and it ends (UIGestureRecognizerStateEnded) when the user lifts any of the fingers.

Topics

Configuring the Gesture Recognizer

minimumPressDuration

The minimum time that the user must press on the view for the gesture to be recognized.

numberOfTouchesRequired

The number of fingers that must touch the view for gesture recognition.

numberOfTapsRequired

The number of taps on the view necessary for gesture recognition.

allowableMovement

The maximum movement of the fingers on the view before the gesture fails.

Relationships

Inherits From

See Also

Standard Gestures

Handling UIKit Gestures

Use gesture recognizers to simplify touch handling and create a consistent user experience.

Coordinating Multiple Gesture Recognizers

Discover how to use multiple gesture recognizers on the same view.

UIHoverGestureRecognizer

A discrete gesture recognizer that interprets pointer movement over a view.

UIPanGestureRecognizer

A discrete gesture recognizer that interprets panning gestures.

UIPinchGestureRecognizer

A discrete gesture recognizer that interprets pinching gestures involving two touches.

UIRotationGestureRecognizer

A discrete gesture recognizer that interprets rotation gestures involving two touches.

UIScreenEdgePanGestureRecognizer

A discrete gesture recognizer that interprets panning gestures that start near an edge of the screen.

UISwipeGestureRecognizer

A discrete gesture recognizer that interprets swiping gestures in one or more directions.

UITapGestureRecognizer

A discrete gesture recognizer that interprets single or multiple taps.