touchesCancelled(_:with:)
Sent to the gesture recognizer when a system event (such as an incoming phone call) cancels a touch event.
Declaration
func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent)Parameters
Discussion
This method has the same exact signature as the corresponding one declared by UIResponder. Through this method a gesture recognizer receives touch objects (in their UITouch.Phase.cancelled phase) before the view attached to the gesture recognizer receives them. UIGestureRecognizer objects are not in the responder chain, yet observe touches hit-tested to their view and their view’s subviews. After observation, the delivery of touch objects to the attached view, or their disposition otherwise, is affected by the cancelsTouchesInView, delaysTouchesBegan, and delaysTouchesEnded properties.
Upon receiving this message, the gesture recognizer for a continuous gesture should set its state to UIGestureRecognizer.State.cancelled; a gesture recognizer for a discrete gesture should set its state to UIGestureRecognizer.State.failed.
See Also
Implementing subclasses
touchesBegan(_:with:)touchesMoved(_:with:)touchesEnded(_:with:)touchesEstimatedPropertiesUpdated(_:)reset()ignore(_:for:)canBePrevented(by:)canPrevent(_:)shouldReceive(_:)shouldRequireFailure(of:)shouldBeRequiredToFail(by:)ignore(_:for:)pressesBegan(_:with:)pressesChanged(_:with:)pressesEnded(_:with:)