SwipeGesture
public struct SwipeGesture : Gesture
Wrapper of UISwipeGestureRecognizer A discrete gesture recognizer that interprets swiping gestures in one or more directions.
SwipeGesture(numberOfTouchesRequired: 1, direction:.right) { swipe in
// swipe action
}
-
The action to handle the gesture recognized by the receiver.
Declaration
Swift
public var action: (UIGestureRecognizer) -> Void { get }
-
The gesture behind the SwipeGesture.
Declaration
Swift
public var gesture: UIGestureRecognizer { get }
-
Initializer
Declaration
Swift
public init(numberOfTouchesRequired: Int, direction: UISwipeGestureRecognizer.Direction, onSwipeGesture: @escaping (_ gesture: UIGestureRecognizer) -> Void)
Parameters
numberOfTouchesRequired
The number of touches necessary for swipe recognition.
direction
The permitted direction of the swipe for this gesture recognizer.
onSwipeGesture
The action to handle the gesture recognized by the receiver.