<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIResponder/touchesCancelled(_:with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIResponder(im)touchesCancelled:withEvent:"
  },
  "title" : "touchesCancelled(_:with:)"
}
-->

# touchesCancelled(_:with:)

Tells the responder when a system event (such as a system alert) cancels a touch sequence.

```
func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?)
```

## Parameters

`touches`

A set of [`UITouch`](/documentation/UIKit/UITouch) instances that represent the touches for the ending phase of the event represented by `event`. For touches in a view, this set contains only one touch by default. To receive multiple touches, you must set the view’s [`isMultipleTouchEnabled`](/documentation/UIKit/UIView/isMultipleTouchEnabled) property to <doc://com.apple.documentation/documentation/Swift/true>.

`event`

The event to which the touches belong.

## Discussion

UIKit calls this method when it receives a system interruption requiring cancellation of the touch sequence. An interruption is anything that causes the application to become inactive or causes the view handling the touch events to be removed from its window. Your implementation of this method should clean up any state associated with handling the touch sequence. The default implementation of this method forwards the message up the responder chain. When creating your own subclasses, call `super` to forward any events that you don’t handle yourself, like in the following code.

```swift
super.touchesCancelled(touches, with: event)
```

If you override this method without calling `super` (a common use pattern), you must also override the other methods for handling touch events, if only as stub (empty) implementations.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)