touchesEnded(_:with:)
Sent to the gesture recognizer when one or more fingers lift from the associated view.
Declaration
func touchesEnded(_ 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.ended 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.
If the gesture recognizer is interpreting a continuous gesture, it should set its state to UIGestureRecognizer.State.ended upon receiving this message. If it is interpreting a discrete gesture, it should set its state to recognized. If at any point in its handling of the touch objects the gesture recognizer determines that the multi-touch event sequence is not its gesture, it should set it state to UIGestureRecognizer.State.cancelled.
Multiple touches are disabled by default. In order to receive multiple touch events you must set the a isMultipleTouchEnabled property of the attached view instance to true.
See Also
Implementing subclasses
touchesBegan(_:with:)touchesMoved(_:with:)touchesCancelled(_:with:)touchesEstimatedPropertiesUpdated(_:)reset()ignore(_:for:)canBePrevented(by:)canPrevent(_:)shouldReceive(_:)shouldRequireFailure(of:)shouldBeRequiredToFail(by:)ignore(_:for:)pressesBegan(_:with:)pressesChanged(_:with:)pressesEnded(_:with:)