Contents

UIDocumentPickerViewController

A view controller that provides access to documents or destinations outside your app’s sandbox.

Declaration

@MainActor class UIDocumentPickerViewController

Mentioned in

Overview

Use a document picker view controller to select a document to open or export, and optionally copy. Don’t copy the document if you can avoid it. The document picker operates in two modes:

  • Open a document. The user selects a document. The document picker provides access to the document, and the user can edit the document in place. Optionally, you can specify that the document picker makes a copy of the document, leaving the original unchanged.

  • Export a local document. The user selects a destination. The document picker moves the document, and the user can access it and edit it in place. Optionally, you can specify that the document picker makes a copy of the document, leaving the original unchanged.

Work with external documents

Both the open and export operations grant access to documents outside your app’s sandbox. This access gives users an unprecedented amount of flexibility when working with their documents. However, it also adds a layer of complexity to your file handling. External documents have the following additional requirements:

For more information about working with external documents, see Providing access to directories and Adding a document browser to your app.

Topics

Creating a document picker

Getting the user-selected document

Configuring a document picker

Deprecated

Initializers

See Also

Documents and directories