Declaration

Overview

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

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 UISupportsDocumentBrowser key, or both the UIFileSharingEnabled and LSSupportsOpeningDocumentsInPlace keys in its Info.plist file. When the user opens a document from another app's Documents directory, they're editing the document in place. The changes are saved 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; 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 FileProvider.

Important

Don't assume that the files you access are local. Files can be stored in iCloud Drive, or on any cloud storage that provides a current File Provider extension.

Remember that the system (or other apps) might modify the files provided by the document browser at any time. Therefore, you must coordinate your access to these files using either a UIDocument subclass or NSFilePresenter and NSFileCoordinator objects.