---
title: "CollectionDifference.Change.insert(offset:element:associatedWith:)"
framework: swift
role: symbol
role_heading: Case
path: "swift/collectiondifference/change/insert(offset:element:associatedwith:)"
---

# CollectionDifference.Change.insert(offset:element:associatedWith:)

An insertion.

## Declaration

```swift
case insert(offset: Int, element: ChangeElement, associatedWith: Int?)
```

## Discussion

Discussion The offset value is the offset of the inserted element in the final state of the collection after the difference is fully applied. A non-nil associatedWith value is the offset of the complementary change.
