---
title: "replaceItems(in:at:count:with:)"
framework: usdkit
role: symbol
role_heading: Instance Method
path: "usdkit/usdlayer/listoperation/replaceitems(in:at:count:with:)"
---

# replaceItems(in:at:count:with:)

Replaces count items in operation’s slot starting at index with newItems.

## Declaration

```swift
mutating func replaceItems(in operation: USDLayer.ListOperationType, at index: Int, count: Int, with newItems: [T]) throws
```

## Parameters

- `operation`: The slot to update.
- `index`: The starting index of the range to replace.
- `count`: The number of items to replace.
- `newItems`: The replacement items.

## Discussion

Discussion note: An error if the range is out of bounds.
