UISwipeGestureRecognizer

extension UISwipeGestureRecognizer
  • A convenience initializer for a UISwipeGestureRecognizer so that it can be configured with a single line of code.

    Declaration

    Swift

    public convenience init(direction: UISwipeGestureRecognizer.Direction = .right,
                            touchesRequired: Int = 1,
                            handler: @escaping (_ gesture: UISwipeGestureRecognizer) -> Void)

    Parameters

    direction

    Defaults UISwipeGestureRecognizer’s direction property value

    touchesRequired

    Defaults UISwipeGestureRecognizer’s numberOfTouchesRequired property value

    handler

    The closure that is called when the gesture is recognized