TapGesture
public struct TapGesture : Gesture
Wrapper of UITapGestureRecognizer A discrete gesture recognizer that interprets single or multiple taps.
TapGesture(numberOfTaps: 1, numberOfTouches: 1) { tap in
// tap action
}
-
The action to handle the gesture recognized by the receiver.
Declaration
Swift
public var action: (UIGestureRecognizer) -> Void { get }
-
The gesture behind the TapGesture.
Declaration
Swift
public var gesture: UIGestureRecognizer { get }
-
Initializer
Declaration
Swift
public init(numberOfTaps: Int = 1, numberOfTouches: Int = 1, onTapGesture: @escaping (_ gesture: UIGestureRecognizer) -> Void)
Parameters
numberOfTaps
The number of taps necessary for gesture recognition.
numberOfTouches
The number of fingers that the user must tap for gesture recognition.
onTapGesture
The action to handle the gesture recognized by the receiver.