---
title: "replace(with:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/meshresource/replace(with:)-g0kn"
---

# replace(with:)

Replace the contents of this mesh resource.

## Declaration

```swift
@MainActor @preconcurrency func replace(with content: MeshResource.Contents) throws
```

## Discussion

Discussion note: The contents of the modified mesh resource will not be synced between network clients.

## See Also

### Configuring the resource

- [expectedMaterialCount](realitykit/meshresource/expectedmaterialcount.md)
- [replaceAsync(with:)](realitykit/meshresource/replaceasync(with:).md)
