<!--
{
  "documentType" : "article",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Documents",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Documents"
}
-->

# Documents

Enable people to open and manage documents.

## Overview

Create a user interface for opening and editing documents.

![](images/com.apple.SwiftUI/documents-hero@2x.png)

Use the <doc://com.apple.documentation/documentation/SwiftUI/ReadableDocument> and <doc://com.apple.documentation/documentation/SwiftUI/WritableDocument> protocols to define your document model, or adopt <doc://com.apple.documentation/documentation/SwiftUI/Document>, a convenience protocol that combines both, when your document needs to support reading and writing. They give you direct access to file URLs, integrate with Swift concurrency, and support progress reporting. You can also use SwiftData-backed documents using an initializer like <doc://com.apple.documentation/documentation/SwiftUI/DocumentGroup/init(editing:contentType:editor:prepareDocument:)>.

SwiftUI supports standard behaviors people expect from a document-based app, appropriate for each platform, like multiwindow support, open and save panels. For related design guidance, see <doc://com.apple.documentation/design/Human-Interface-Guidelines/patterns> in the Human Interface Guidelines.

## Topics

### Creating a document

[Creating a document-based app](/documentation/SwiftUI/Creating-a-document-based-app)

Build apps that people can use to open, edit, and save files using coordinated file access.

[Handling advanced document scenarios](/documentation/SwiftUI/Handling-advanced-document-scenarios)

Extend your document-based app to support custom file formats, on-demand file access, and progress reporting.

  <doc:Creating-document-based-apps>

[Updating your document-based app](/documentation/SwiftUI/Updating-your-document-based-app)

Migrate an existing app to adopt URL-based document reading and writing with Swift concurrency.

[Building a document-based app with SwiftUI](/documentation/SwiftUI/Building-a-document-based-app-with-SwiftUI)

Create, save, and open documents in a multiplatform app.

[Building a document-based app using SwiftData](/documentation/SwiftUI/Building-a-document-based-app-using-SwiftData)

Code along with the WWDC presenter to transform an app with SwiftData.

[`DocumentGroup`](/documentation/SwiftUI/DocumentGroup)

A scene that enables support for opening, creating, and saving documents.

### Storing document data in a reference type instance

[`Document`](/documentation/SwiftUI/Document)

A document that supports both reading and writing.

[`ReadableDocument`](/documentation/SwiftUI/ReadableDocument)

A document type that supports reading from file.

[`WritableDocument`](/documentation/SwiftUI/WritableDocument)

A document type that supports writing to file.

[`URLDocumentConfiguration`](/documentation/SwiftUI/URLDocumentConfiguration)

The configuration of an open document that stores its file URL,
last modification date, and related metadata.

[`DocumentCreationContext`](/documentation/SwiftUI/DocumentCreationContext)

Context about how a document was created.

[`DocumentBaseBox`](/documentation/SwiftUI/DocumentBaseBox)

A Box that allows setting its Document base
not requiring the caller to know the exact types of the box and its base.

### Accessing document configuration

[`documentConfiguration`](/documentation/SwiftUI/EnvironmentValues/documentConfiguration)

The configuration of a document in a [`DocumentGroup`](/documentation/SwiftUI/DocumentGroup).

[`DocumentConfiguration`](/documentation/SwiftUI/DocumentConfiguration)

The configuration of a document in a [`DocumentGroup`](/documentation/SwiftUI/DocumentGroup).

[`undoManager`](/documentation/SwiftUI/EnvironmentValues/undoManager)

The undo manager used to register a view’s undo operations.

### Reading and writing documents

[`DocumentReadConfiguration`](/documentation/SwiftUI/DocumentReadConfiguration)

The context SwiftUI passes to
[`reader(configuration:)`](/documentation/SwiftUI/ReadableDocument/reader(configuration:)).

[`DocumentWriteConfiguration`](/documentation/SwiftUI/DocumentWriteConfiguration)

The context SwiftUI passes to
[`writer(configuration:)`](/documentation/SwiftUI/WritableDocument/writer(configuration:)).

[`DocumentReader`](/documentation/SwiftUI/DocumentReader)

A type that reads a document’s content from a file.

[`DocumentWriter`](/documentation/SwiftUI/DocumentWriter)

A type that writes a document’s content to a file.

[`FileWrapperDocumentReader`](/documentation/SwiftUI/FileWrapperDocumentReader)

A document reader that deserializes a `FileWrapper` into a snapshot.

[`FileWrapperDocumentWriter`](/documentation/SwiftUI/FileWrapperDocumentWriter)

A document writer that serializes a snapshot into a `FileWrapper`.

### Opening a document programmatically

[`newDocument`](/documentation/SwiftUI/EnvironmentValues/newDocument)

An action in the environment that presents a new document.

[`openDocument`](/documentation/SwiftUI/EnvironmentValues/openDocument)

An action in the environment that presents an existing document.

[`OpenDocumentAction`](/documentation/SwiftUI/OpenDocumentAction)

An action that presents an existing document.

### Configuring the document launch experience

[`DocumentGroupLaunchScene`](/documentation/SwiftUI/DocumentGroupLaunchScene)

A launch scene for document-based applications.

[`documentLaunchTitle(_:)`](/documentation/SwiftUI/Scene/documentLaunchTitle(_:))

Sets the title displayed on the document launch card.

[`documentLaunchSubtitle(_:)`](/documentation/SwiftUI/Scene/documentLaunchSubtitle(_:))

Sets the subtitle displayed beneath the title on the document
launch card.

[`DocumentLaunchView`](/documentation/SwiftUI/DocumentLaunchView)

A view to present when launching document-related user experience.

[`documentLaunchTitle(_:)`](/documentation/SwiftUI/View/documentLaunchTitle(_:))

Sets the title displayed on the document launch card.

[`documentLaunchSubtitle(_:)`](/documentation/SwiftUI/View/documentLaunchSubtitle(_:))

Sets the subtitle displayed beneath the title on the document
launch card.

[`documentBrowserContextMenu(_:)`](/documentation/SwiftUI/View/documentBrowserContextMenu(_:))

Adds to a `DocumentLaunchView` actions that accept
a list of selected files as their parameter.

[`DocumentLaunchGeometryProxy`](/documentation/SwiftUI/DocumentLaunchGeometryProxy)

A proxy for access to the frame of the scene and its title view.

[`DefaultDocumentGroupLaunchActions`](/documentation/SwiftUI/DefaultDocumentGroupLaunchActions)

The default actions for the document group launch scene and the document launch view.

[`NewDocumentButton`](/documentation/SwiftUI/NewDocumentButton)

A button that creates and opens new documents.

[`DefaultNewDocumentButtonLabel`](/documentation/SwiftUI/DefaultNewDocumentButtonLabel)

The default label used for a new document button.

[`DocumentCreationSource`](/documentation/SwiftUI/DocumentCreationSource)

Describes the source used to create a new document.

### Renaming a document

[`RenameButton`](/documentation/SwiftUI/RenameButton)

A button that triggers a standard rename action.

[`renameAction(_:)`](/documentation/SwiftUI/View/renameAction(_:))

Sets a closure to run for the rename action.

[`rename`](/documentation/SwiftUI/EnvironmentValues/rename)

An action that activates the standard rename interaction.

[`RenameAction`](/documentation/SwiftUI/RenameAction)

An action that activates a standard rename interaction.

### Deprecated

[`FileDocument`](/documentation/SwiftUI/FileDocument)

A type that you use to serialize documents to and from file.

[`FileDocumentConfiguration`](/documentation/SwiftUI/FileDocumentConfiguration)

The properties of an open file document.

[`FileDocumentReadConfiguration`](/documentation/SwiftUI/FileDocumentReadConfiguration)

The configuration for reading file contents.

[`FileDocumentWriteConfiguration`](/documentation/SwiftUI/FileDocumentWriteConfiguration)

The configuration for serializing file contents.

[`NewDocumentAction`](/documentation/SwiftUI/NewDocumentAction)

An action that presents a new document.

[`ReferenceFileDocument`](/documentation/SwiftUI/ReferenceFileDocument)

A type that you use to serialize reference type documents to and from file.

[`ReferenceFileDocumentConfiguration`](/documentation/SwiftUI/ReferenceFileDocumentConfiguration)

The properties of an open reference file document.



---

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)