---
title: "replace(_:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/lowlevelinstancetransformresource/replace(_:)"
---

# replace(_:)

Provides full read-write CPU access, replacing all transform data.

## Declaration

```swift
final func replace<R, E>(_ body: @_lifetime(0: copy 0) (inout MutableSpan<float4x4>) throws(E) -> R) throws(E) -> R where E : Error, R : ~Copyable
```

## Parameters

- `body`: A closure that receives a MutableSpan<float4x4> for the new transform data. The span is valid only for the duration of the closure.

## See Also

### Replacing transform data

- [replace(commandBuffer:)](realitykit/lowlevelinstancetransformresource/replace(commandbuffer:).md)
