canBePrevented(by:)
Overridden to indicate that the specified gesture recognizer can prevent the receiver from recognizing a gesture.
Declaration
func canBePrevented(by preventingGestureRecognizer: UIGestureRecognizer) -> BoolParameters
- preventingGestureRecognizer:
An instance of a subclass of
UIGestureRecognizer.
Return Value
true to indicate that preventingGestureRecognizer can block the receiver from recognizing its gesture, otherwise false.
Discussion
Overriding these methods enables the same behavior as implementing the UIGestureRecognizerDelegate methods gestureRecognizerShouldBegin(_:) and gestureRecognizer(_:shouldReceive:). However, by overriding them, subclasses can define class-wide prevention rules. For example, a UITapGestureRecognizer object never prevents another UITapGestureRecognizer object with a higher tap count.
See Also
Implementing subclasses
touchesBegan(_:with:)touchesMoved(_:with:)touchesEnded(_:with:)touchesCancelled(_:with:)touchesEstimatedPropertiesUpdated(_:)reset()ignore(_:for:)canPrevent(_:)shouldReceive(_:)shouldRequireFailure(of:)shouldBeRequiredToFail(by:)ignore(_:for:)pressesBegan(_:with:)pressesChanged(_:with:)pressesEnded(_:with:)