<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIDocumentPickerDelegate/documentPickerWasCancelled(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIDocumentPickerDelegate(im)documentPickerWasCancelled:"
  },
  "title" : "documentPickerWasCancelled(_:)"
}
-->

# documentPickerWasCancelled(_:)

Tells the delegate that the user canceled the document picker.

```
optional func documentPickerWasCancelled(_ controller: UIDocumentPickerViewController)
```

## Parameters

`controller`

The document picker that called this method.

---

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)