canPrevent(_:)
Overridden to indicate that the receiver can prevent the specified gesture recognizer from recognizing its gesture.
Declaration
func canPrevent(_ preventedGestureRecognizer: UIGestureRecognizer) -> BoolParameters
- preventedGestureRecognizer:
An instance of a subclass of
UIGestureRecognizer.
Return Value
true to indicate that the receiver can block preventedGestureRecognizer 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:)canBePrevented(by:)shouldReceive(_:)shouldRequireFailure(of:)shouldBeRequiredToFail(by:)ignore(_:for:)pressesBegan(_:with:)pressesChanged(_:with:)pressesEnded(_:with:)