<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIDocumentBrowserViewControllerDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIDocumentBrowserViewControllerDelegate"
  },
  "title" : "UIDocumentBrowserViewControllerDelegate"
}
-->

# UIDocumentBrowserViewControllerDelegate

The protocol you implement to respond as the user interacts with the document browser.

```
protocol UIDocumentBrowserViewControllerDelegate : NSObjectProtocol
```

## Topics

### Creating new documents

[`func documentBrowser(UIDocumentBrowserViewController, didRequestDocumentCreationWithHandler: (URL?, UIDocumentBrowserViewController.ImportMode) -> Void)`](/documentation/UIKit/UIDocumentBrowserViewControllerDelegate/documentBrowser(_:didRequestDocumentCreationWithHandler:))

Asks the delegate to create a new document.

[`enum ImportMode`](/documentation/UIKit/UIDocumentBrowserViewController/ImportMode)

The document browser’s import modes.

[`func documentBrowser(UIDocumentBrowserViewController, didImportDocumentAt: URL, toDestinationURL: URL)`](/documentation/UIKit/UIDocumentBrowserViewControllerDelegate/documentBrowser(_:didImportDocumentAt:toDestinationURL:))

Tells the delegate that a document has been successfully imported.

[`func documentBrowser(UIDocumentBrowserViewController, failedToImportDocumentAt: URL, error: (any Error)?)`](/documentation/UIKit/UIDocumentBrowserViewControllerDelegate/documentBrowser(_:failedToImportDocumentAt:error:))

Tells the delegate that the document browser failed to import the specified document.

### Selecting documents

[`func documentBrowser(UIDocumentBrowserViewController, didPickDocumentsAt: [URL])`](/documentation/UIKit/UIDocumentBrowserViewControllerDelegate/documentBrowser(_:didPickDocumentsAt:))

Tells the delegate that the user has selected one or more documents.

### Working with the browser’s activity view

[`func documentBrowser(UIDocumentBrowserViewController, willPresent: UIActivityViewController)`](/documentation/UIKit/UIDocumentBrowserViewControllerDelegate/documentBrowser(_:willPresent:))

Tells the delegate that the document browser will display an activity view.

[`func documentBrowser(UIDocumentBrowserViewController, applicationActivitiesForDocumentURLs: [URL]) -> [UIActivity]`](/documentation/UIKit/UIDocumentBrowserViewControllerDelegate/documentBrowser(_:applicationActivitiesForDocumentURLs:))

Asks the delegate for additional activities when displaying an activity view.

### Deprecated methods

[`func documentBrowser(UIDocumentBrowserViewController, didPickDocumentURLs: [URL])`](/documentation/UIKit/UIDocumentBrowserViewControllerDelegate/documentBrowser(_:didPickDocumentURLs:))

Tells the delegate that the user has selected one or more documents.

## See Also

[`class UIDocumentBrowserViewController`](/documentation/UIKit/UIDocumentBrowserViewController)

A view controller for browsing and performing actions on documents that you store locally and in the cloud.

## Relationships

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

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)