LongPressGesture
public struct LongPressGesture : Gesture
Wrapper of UILongPressGestureRecognizer A discrete gesture recognizer that interprets long-press gestures.
LongPressGesture(numberOfTaps: 1, numberOfTouches: 1, minimumPressDuration: 0.5, allowableMovement: 10) { longPress in
// long press action
}
-
The action to handle the gesture recognized by the receiver.
Declaration
Swift
public var action: (UIGestureRecognizer) -> Void { get }
-
The gesture behind the LongPressGesture.
Declaration
Swift
public var gesture: UIGestureRecognizer { get }
-
Initializer
Declaration
Swift
public init(numberOfTaps: Int = 0, numberOfTouches: Int = 1, minimumPressDuration: TimeInterval = 0.5, allowableMovement: CGFloat = 10, onLongPressGesture: @escaping (_ gesture: UIGestureRecognizer) -> Void)
Parameters
numberOfTaps
The number of taps on the view necessary for gesture recognition.
numberOfTouches
The number of fingers that must touch the view for gesture recognition.
minimumPressDuration
The minimum time that the user must press on the view for the gesture to be recognized.
allowableMovement
The maximum movement of the fingers on the view before the gesture fails.
onLongPressGesture
The action to handle the gesture recognized by the receiver.