---
title: "writeAdditionalContent(_:to:originalContentsURL:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uimanageddocument/writeadditionalcontent(_:to:originalcontentsurl:)"
---

# writeAdditionalContent(_:to:originalContentsURL:)

Handles writing non-Core Data content to the document’s file package.

## Declaration

```swift
func writeAdditionalContent(_ content: Any, to absoluteURL: URL, originalContentsURL absoluteOriginalContentsURL: URL?) throws
```

## Parameters

- `content`: An object that represents the additional content for the document. This is the object returned from doc://com.apple.uikit/documentation/UIKit/UIManagedDocument/additionalContent(for:).
- `absoluteURL`: The URL to which to write the additional content.
- `absoluteOriginalContentsURL`: The current URL of the document that’s being saved.

## Discussion

Discussion You override this method to perform to write non-Core Data content in the additional content directory in the document’s file package. There are several issues to consider: You should typically implement this method only if you also implemented additionalContent(for:). Because this method is executed asynchronously, it’s possible that the document’s state may be different from that at which the save operation was initiated. If you need to capture the document state at save time, you should do so in additionalContent(for:). If you implement this method, it’s invoked automatically by writeContents(_:andAttributes:safelyTo:for:). There’s no need to invoke super’s implementation. note: In Swift, this method is marked with the throws keyword to indicate that it throws an error in cases of failure. When overriding this method, use the throw statement to throw an NSError, as described in Error Handling in The Swift Programming Language and About Imported Cocoa Error Parameters. Special considerations Additional content isn’t supported on iCloud.

## See Also

### Customizing read and write operations

- [readAdditionalContent(from:)](uikit/uimanageddocument/readadditionalcontent(from:).md)
- [additionalContent(for:)](uikit/uimanageddocument/additionalcontent(for:).md)
