<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "USDKit",
  "identifier" : "/documentation/USDKit/USDLayer/ListOperation/replaceItems(in:at:count:with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "USDKit"
    ],
    "preciseIdentifier" : "s:6USDKit8USDLayerV13ListOperationV12replaceItems2in2at5count4withyAC0cD4TypeO_S2iSayxGtKF"
  },
  "title" : "replaceItems(in:at:count:with:)"
}
-->

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

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

```
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> Throws: An error if the range is out of bounds.

---

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)