Contents

addGestureRecognizer(_:)

Attaches a gesture recognizer to the view.

Declaration

func addGestureRecognizer(_ gestureRecognizer: NSGestureRecognizer)

Parameters

  • gestureRecognizer:

    The gesture recognizer to attach to the view. This parameter must not be nil.

Discussion

Attaching a gesture recognizer to a view defines the scope of the represented gesture, causing it to receive touches occurring only in the view or one of its subviews. The view establishes a strong reference to the specified gesture recognizer.

See Also

Managing Gesture Recognizers