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

# pressesCancelled(_:with:)

Tells this object when a system event (such as a low-memory warning) cancels a press event.

```
func pressesCancelled(_ presses: Set<UIPress>, with event: UIPressesEvent?)
```

## Parameters

`presses`

A set of [`UIPress`](/documentation/UIKit/UIPress) instances that represent the presses associated with the event. The phase of each press is set to [`UIPress.Phase.cancelled`](/documentation/UIKit/UIPress/Phase-swift.enum/cancelled).

`event`

The event to which the presses belong.

## Discussion

UIKit calls this method when it receives a system interruption requiring cancellation of the press sequence. An interruption is anything that causes the application to become inactive or causes the view handling the press events to be removed from its window. Your implementation of this method should clean up any state associated with handling the press sequence. Failure to handle cancellation is likely to lead to incorrect behavior or crashes.

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.

---

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)