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
numberOfTapsThe number of taps on the view necessary for gesture recognition.
numberOfTouchesThe number of fingers that must touch the view for gesture recognition.
minimumPressDurationThe minimum time that the user must press on the view for the gesture to be recognized.
allowableMovementThe maximum movement of the fingers on the view before the gesture fails.
onLongPressGestureThe action to handle the gesture recognized by the receiver.
LongPressGesture Structure Reference