Instance Method


Attaches a gesture recognizer to the view.


func addGestureRecognizer(_ gestureRecognizer: UIGestureRecognizer)



An object whose class descends from the UIGestureRecognizer class. This parameter must not be nil.


Attaching a gesture recognizer to a view defines the scope of the represented gesture, causing it to receive touches hit-tested to that view and all of its subviews. The view establishes a strong reference to the gesture recognizer.

See Also

Managing Gesture Recognizers

func removeGestureRecognizer(UIGestureRecognizer)

Detaches a gesture recognizer from the receiving view.

var gestureRecognizers: [UIGestureRecognizer]?

The gesture-recognizer objects currently attached to the view.

func gestureRecognizerShouldBegin(UIGestureRecognizer) -> Bool

Asks the view if the gesture recognizer should be allowed to continue tracking touch events.