---
title: "set(_:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/ikrig/constraintscollection/set(_:)"
---

# set(_:)

Updates the element with identifier matching the provided value’s identifier.

## Declaration

```swift
@discardableResult mutating func set(_ newValue: IKRig.ConstraintsCollection.Element) -> IKRig.ConstraintsCollection.Element?
```

## Parameters

- `newValue`: The new element value to store.

## Return Value

Return Value The previous element value if the identifier exists, nil otherwise.

## Discussion

Discussion If an element with the provided identifier is not contained, adds a new one.
