---
title: "updateContents(data:)"
framework: spatialpreview
role: symbol
role_heading: Instance Method
path: "spatialpreview/documentpreviewsession/updatecontents(data:)"
---

# updateContents(data:)

Update the contents of the document with the provided data.

## Declaration

```swift
final nonisolated(nonsending) func updateContents(data: Data) async throws
```

## Parameters

- `data`: The new document contents.
