<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/DocumentWriteConfiguration",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI26DocumentWriteConfigurationV"
  },
  "title" : "DocumentWriteConfiguration"
}
-->

# DocumentWriteConfiguration

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

```
struct DocumentWriteConfiguration
```

## Overview

Contains the [`contentType`](/documentation/SwiftUI/DocumentWriteConfiguration/contentType) of the file being written (one of
the document’s [`writableContentTypes`](/documentation/SwiftUI/WritableDocument/writableContentTypes)). Use it
to choose the correct serialization strategy when a document
supports exporting to multiple formats.

Access this type through the
[`WritableDocument.WriteConfiguration`](/documentation/SwiftUI/WritableDocument/WriteConfiguration) typealias.

## Topics

### Accessing write properties

[`var contentType: UTType`](/documentation/SwiftUI/DocumentWriteConfiguration/contentType)

The content type of the file being written.

## Relationships

### Conforms To

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

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

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

---

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)