Instance Method

gestureRecognizer(_:shouldReceive:)

Ask the delegate if a gesture recognizer should receive an object representing a touch.

Declaration

optional func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool

Parameters

gestureRecognizer

An instance of a subclass of the abstract base class UIGestureRecognizer.

touch

A UITouch object from the current multi-touch sequence.

Return Value

true (the default) to allow the gesture recognizer to examine the touch object, false to prevent the gesture recognizer from seeing this touch object.

Discussion

UIKit calls this method before calling the touchesBegan(_:with:) method of the gesture recognizer.

See Also

Regulating Gesture Recognition

func gestureRecognizerShouldBegin(UIGestureRecognizer)

Asks the delegate if a gesture recognizer should begin interpreting touches.

func gestureRecognizer(UIGestureRecognizer, shouldReceive: UIPress)

Ask the delegate if a gesture recognizer should receive an object representing a press.