---
title: "replaceAll(_:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/entitycollection/replaceall(_:)"
---

# replaceAll(_:)

Replaces all entities in this collection with those from the given sequence.

## Declaration

```swift
mutating func replaceAll<S>(_ entities: S) where S : Sequence, S.Element : Entity
```

## Parameters

- `entities`: The sequence of entities that will replace the collection’s current contents.

## Discussion

Discussion note: This operation might not maintain the new entities’ index order.
