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

# UIDocumentBrowserViewController

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

```
@MainActor class UIDocumentBrowserViewController
```

## Overview

With the document browser view controller, users can easily access and view their documents in the cloud. By default, the document browser can access both the system’s local file provider and its iCloud file provider.

![A screenshot of the document browser. The On My iPad location is in a selected state on the left, and several photos and folders appear in the pane on the right.](images/com.apple.uikit/media-2922157@2x.png)

The local file provider grants access to all the documents in the app’s `Documents` directory. Users can also access documents from another app’s `Documents` directory, if that app declares either the <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/UISupportsDocumentBrowser> key, or both the <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/UIFileSharingEnabled> and <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/LSSupportsOpeningDocumentsInPlace> keys in its `Info.plist` file. When the user opens a document from another app’s `Documents` directory, they edit the document in place, and save the changes to the other app’s `Documents` directory.

The iCloud file provider creates a folder for your app in the user’s iCloud Drive. Users can access documents from this folder, or from anywhere in their iCloud Drive. The system automatically handles access to iCloud for you, so you don’t need to enable your app’s iCloud capabilities.

Third-party storage services can also provide access to the documents they manage by implementing a File Provider extension (iOS 11 or later). For more information, see <doc://com.apple.documentation/documentation/FileProvider>.

> Important:
> Don’t assume that the files you access are local. Users can store files in iCloud Drive, or in any cloud storage that provides a current File Provider extension.
> 
> Remember that the system (or other apps) might modify the files that the document browser provides at any time. Therefore, you must coordinate your access to these files using either a ``doc://com.apple.uikit/documentation/UIKit/UIDocument`` subclass, or <doc://com.apple.documentation/documentation/Foundation/NSFilePresenter> and <doc://com.apple.documentation/documentation/Foundation/NSFileCoordinator> objects.

## Topics

### Creating a document browser

[Adding a document browser to your app](/documentation/UIKit/adding-a-document-browser-to-your-app)

Give people access to their local or remote documents from within your app.

[`init(forOpening: [UTType]?)`](/documentation/UIKit/UIDocumentBrowserViewController/init(forOpening:))

Initializes and returns a document browser view controller that can open the specified file types.

### Creating new documents

[`var activeDocumentCreationIntent: UIDocument.CreationIntent?`](/documentation/UIKit/UIDocumentBrowserViewController/activeDocumentCreationIntent)

The current intent that defines how your app creates a document.

### Responding to browser events

[`var delegate: (any UIDocumentBrowserViewControllerDelegate)?`](/documentation/UIKit/UIDocumentBrowserViewController/delegate)

The document browser’s delegate.

[`protocol UIDocumentBrowserViewControllerDelegate`](/documentation/UIKit/UIDocumentBrowserViewControllerDelegate)

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

[`func importDocument(at: URL, nextToDocumentAt: URL, mode: UIDocumentBrowserViewController.ImportMode, completionHandler: (URL?, (any Error)?) -> Void)`](/documentation/UIKit/UIDocumentBrowserViewController/importDocument(at:nextToDocumentAt:mode:completionHandler:))

Imports a document into the same location as an existing document.

### Configuring a document browser

[`var allowsDocumentCreation: Bool`](/documentation/UIKit/UIDocumentBrowserViewController/allowsDocumentCreation)

A Boolean value that determines whether the document browser can create new documents.

[`var allowsPickingMultipleItems: Bool`](/documentation/UIKit/UIDocumentBrowserViewController/allowsPickingMultipleItems)

A Boolean value that determines whether the user can select and open more than one document at a time.

[`func revealDocument(at: URL, importIfNeeded: Bool, completion: ((URL?, (any Error)?) -> Void)?)`](/documentation/UIKit/UIDocumentBrowserViewController/revealDocument(at:importIfNeeded:completion:))

Reveals, and optionally imports, the document at the provided URL.

[`var contentTypesForRecentDocuments: [UTType]`](/documentation/UIKit/UIDocumentBrowserViewController/contentTypesForRecentDocuments)

Content types for browsing recent documents.

### Modifying the browser’s appearance

[`var browserUserInterfaceStyle: UIDocumentBrowserViewController.BrowserUserInterfaceStyle`](/documentation/UIKit/UIDocumentBrowserViewController/browserUserInterfaceStyle-swift.property)

The visual style for the document browser.

[`enum BrowserUserInterfaceStyle`](/documentation/UIKit/UIDocumentBrowserViewController/BrowserUserInterfaceStyle-swift.enum)

Styles that define the document browser’s appearance.

[`var additionalLeadingNavigationBarButtonItems: [UIBarButtonItem]`](/documentation/UIKit/UIDocumentBrowserViewController/additionalLeadingNavigationBarButtonItems)

Additional bar button items that the document browser displays on the leading side of its navigation bar.

[`var additionalTrailingNavigationBarButtonItems: [UIBarButtonItem]`](/documentation/UIKit/UIDocumentBrowserViewController/additionalTrailingNavigationBarButtonItems)

Additional bar button items that the document browser displays on the trailing side of its navigation bar.

[`var shouldShowFileExtensions: Bool`](/documentation/UIKit/UIDocumentBrowserViewController/shouldShowFileExtensions)

A Boolean value that determines whether the browser always shows file extensions.

[`var localizedCreateDocumentActionTitle: String`](/documentation/UIKit/UIDocumentBrowserViewController/localizedCreateDocumentActionTitle)

The title for the Create Document button.

[`var defaultDocumentAspectRatio: CGFloat`](/documentation/UIKit/UIDocumentBrowserViewController/defaultDocumentAspectRatio)

The aspect ratio for the Create Document button.

### Adding custom actions

[`var customActions: [UIDocumentBrowserAction]`](/documentation/UIKit/UIDocumentBrowserViewController/customActions)

Custom document browser actions.

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

A custom action that you can create and add to a document browser’s Edit menu or navigation bar.

### Animating transitions

[`func transitionController(forDocumentAt: URL) -> UIDocumentBrowserTransitionController`](/documentation/UIKit/UIDocumentBrowserViewController/transitionController(forDocumentAt:))

Creates a transition controller that provides the standard system-loading and segue animations for the document browser.

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

An object that implements the standard loading and transition animations for a document browser.

### Renaming a document

[`func renameDocument(at: URL, proposedName: String, completionHandler: (URL?, (any Error)?) -> Void)`](/documentation/UIKit/UIDocumentBrowserViewController/renameDocument(at:proposedName:completionHandler:))

Renames a document at the specified URL.

### Handling errors

[`struct UIDocumentBrowserError`](/documentation/UIKit/UIDocumentBrowserError)

A structure that contains information about document browser errors.

[`enum Code`](/documentation/UIKit/UIDocumentBrowserError/Code)

The error codes for document browser errors.

[`let UIDocumentBrowserErrorDomain: String`](/documentation/UIKit/UIDocumentBrowserErrorDomain)

The error domain for document browser errors.

### Deprecated symbols

[`init(forOpeningFilesWithContentTypes: [String]?)`](/documentation/UIKit/UIDocumentBrowserViewController/init(forOpeningFilesWithContentTypes:))

Initializes and returns a document browser view controller that can open the specified file types.

[`var recentDocumentsContentTypes: [String]`](/documentation/UIKit/UIDocumentBrowserViewController/recentDocumentsContentTypes)

Content types for browsing recent documents.

[`var allowedContentTypes: [String]`](/documentation/UIKit/UIDocumentBrowserViewController/allowedContentTypes)

The document types that the browser can open.

[`func transitionController(forDocumentURL: URL) -> UIDocumentBrowserTransitionController`](/documentation/UIKit/UIDocumentBrowserViewController/transitionController(forDocumentURL:))

Creates a transition controller that provides the standard system-loading and segue animations for the document browser.

### Initializers

[`init(forOpeningContentTypes: [UTType]?)`](/documentation/UIKit/UIDocumentBrowserViewController/init(forOpeningContentTypes:))

## Relationships

### Conforms To

[`NSTouchBarProvider`](/documentation/AppKit/NSTouchBarProvider)

[`UIFocusEnvironment`](/documentation/UIKit/UIFocusEnvironment)

[`UIAppearanceContainer`](/documentation/UIKit/UIAppearanceContainer)

[`UITraitEnvironment`](/documentation/UIKit/UITraitEnvironment)

[`NSExtensionRequestHandling`](/documentation/Foundation/NSExtensionRequestHandling)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

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

[`UIStateRestoring`](/documentation/UIKit/UIStateRestoring)

[`UIContentContainer`](/documentation/UIKit/UIContentContainer)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`UIUserActivityRestoring`](/documentation/UIKit/UIUserActivityRestoring)

[`UITraitChangeObservable-67e94`](/documentation/UIKit/UITraitChangeObservable-67e94)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`UIResponderStandardEditActions`](/documentation/UIKit/UIResponderStandardEditActions)

[`UIActivityItemsConfigurationProviding`](/documentation/UIKit/UIActivityItemsConfigurationProviding)

[`UIPasteConfigurationSupporting`](/documentation/UIKit/UIPasteConfigurationSupporting)

### Inherits From

[`UIViewController`](/documentation/UIKit/UIViewController)

---

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)