<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIManagedDocument/additionalContent(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIManagedDocument(im)additionalContentForURL:error:"
  },
  "title" : "additionalContent(for:)"
}
-->

# additionalContent(for:)

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

```
func additionalContent(for absoluteURL: URL) throws -> Any
```

## Parameters

`absoluteURL`

The URL for the additional content directory in the document’s file package.

## Return Value

An object that contains the additional content for the document at `absoluteURL`, or `nil` if there is a problem.

## Discussion

You override this method to perform to manage non-Core Data content to be stored in the additional content directory in the document’s file package.

If you implement this method, it’s invoked automatically by [`contents(forType:)`](/documentation/UIKit/UIDocument/contents(forType:)). The returned object is passed to [`writeAdditionalContent(_:to:originalContentsURL:)`](/documentation/UIKit/UIManagedDocument/writeAdditionalContent(_:to:originalContentsURL:)).

There’s no need to invoke `super`’s implementation.

> Handling Errors in Swift:
> 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](https://docs.swift.org/swift-book/LanguageGuide/ErrorHandling.html) in [The Swift Programming Language](https://docs.swift.org/swift-book/) and `About Imported Cocoa Error Parameters`.

### Special considerations

A return value of `nil` indicates an error condition. To avoid generating an exception, you must return a value from this method. If it isn’t always the case that there will be additional content, you should return a sentinel value (for example, an <doc://com.apple.documentation/documentation/Foundation/NSNull> instance) that you check for in [`writeAdditionalContent(_:to:originalContentsURL:)`](/documentation/UIKit/UIManagedDocument/writeAdditionalContent(_:to:originalContentsURL:)).

The object returned from this method is passed to [`writeAdditionalContent(_:to:originalContentsURL:)`](/documentation/UIKit/UIManagedDocument/writeAdditionalContent(_:to:originalContentsURL:)). Because [`writeAdditionalContent(_:to:originalContentsURL:)`](/documentation/UIKit/UIManagedDocument/writeAdditionalContent(_:to:originalContentsURL:)) is executed on a different thread, you must ensure that the object you return is thread-safe. For example, you might return an <doc://com.apple.documentation/documentation/Foundation/NSData> object containing an archive of the state you want to capture.

Additional content isn’t supported on iCloud.

---

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)