pressesCancelled(_:with:)
Sent to the receiver when a system event (such as a low-memory warning) cancels a press event.
Declaration
func pressesCancelled(_ presses: Set<UIPress>, with event: UIPressesEvent)Parameters
Mentioned in
Discussion
This method has the same signature as the corresponding one declared by UIResponder. With this method a gesture recognizer receives press objects (in their UIPress.Phase.cancelled phase) before the view attached to the gesture recognizer receives them. UIGestureRecognizer objects are not in the responder chain, yet they observe presses hit-tested to their view and their view’s subviews.
If the gesture recognizer is interpreting a continuous gesture, it should set its state to UIGestureRecognizer.State.began upon receiving this message. If at any point in its handling of the press objects the gesture recognizer determines that the press event sequence is not its gesture, it should set its state to UIGestureRecognizer.State.cancelled.
See Also
Implementing subclasses
touchesBegan(_:with:)touchesMoved(_:with:)touchesEnded(_:with:)touchesCancelled(_:with:)touchesEstimatedPropertiesUpdated(_:)reset()ignore(_:for:)canBePrevented(by:)canPrevent(_:)shouldReceive(_:)shouldRequireFailure(of:)shouldBeRequiredToFail(by:)ignore(_:for:)pressesBegan(_:with:)pressesChanged(_:with:)