One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

IKRig.ConstraintsCollection

struct · iOS 18.0+ · SDK 27.1

struct ConstraintsCollection

Ordered dictionary-like container. Supports subscripting by index, element's identifier or element's name.

Members (12)

get · iOS 18.0+

startIndex

TypeScript
get startIndex(): number
Swift declaration
var startIndex: IKRig.ConstraintsCollection.Index { get }

The position of the first element in a nonempty collection. If the collection is empty, `startIndex` is equal to `endIndex`.

method · iOS 18.0+

makeIterator

TypeScript
makeIterator(): IKRig_ConstraintsCollection_Iterator
Swift declaration
func makeIterator() -> IKRig.ConstraintsCollection.Iterator

Returns an iterator over the elements of the collection.

method · iOS 18.0+

set

TypeScript
set(newValue: IKRig_Constraint): (IKRig_Constraint) | null
Swift declaration
@discardableResult mutating func set(_ newValue: IKRig.ConstraintsCollection.Element) -> IKRig.ConstraintsCollection.Element?

Updates the element with identifier matching the provided value's identifier. If an element with the provided identifier is not contained, adds a new one. - Parameter newValue: The new element value to store. - Returns: The previous element value if the identifier exists, `nil` otherwise.

get · iOS 18.0+

count

TypeScript
get count(): number
Swift declaration
var count: Int { get }

The number of elements in the collection.

method · iOS 18.0+

index

TypeScript
index(after: number): number
Swift declaration
func index(after: IKRig.ConstraintsCollection.Index) -> IKRig.ConstraintsCollection.Index

Returns the position immediately after the given index. The successor of an index must be well defined. For an index `i` into a collection `c`, calling `c.index(after: i)` returns the same index every time. - Parameter i: A valid index of the collection. `i` must be less than `endIndex`. - Returns: The index value immediately after `i`.

get · iOS 18.0+

isEmpty

TypeScript
get isEmpty(): boolean
Swift declaration
var isEmpty: Bool { get }

A Boolean value indicating whether the collection is empty.

method · iOS 18.0+

contains

TypeScript
contains(id: IKRig_Constraint_ID): boolean
Swift declaration
func contains(_ id: IKRig.ConstraintsCollection.Element.ID) -> Bool

Returns a Boolean value that indicates whether the collection contains an element with a specific identifier. - Parameter id: The identifier of the element to look up.

get · iOS 18.0+

endIndex

TypeScript
get endIndex(): number
Swift declaration
var endIndex: IKRig.ConstraintsCollection.Index { get }

The collection's "past the end" position---that is, the position one greater than the last valid subscript argument. When you need a range that includes the last element of a collection, use the half-open range operator (`..<`) with `endIndex`. The `..<` operator creates a range that doesn't include the upper bound, so it's always safe to use with `endIndex`. For example: let numbers = [10, 20, 30, 40, 50] if let index = numbers.firstIndex(of: 30) { print(numbers[index ..< numbers.endIndex]) } // Prints "[30, 40, 50]" If the collection is empty, `endIndex` is equal to `startIndex`.

subscript · iOS 18.0+

subscript

TypeScript
subscript(id: IKRig_Constraint_ID): (IKRig_Constraint) | null
Swift declaration
subscript(id: IKRig.ConstraintsCollection.Element.ID) -> IKRig.ConstraintsCollection.Element? { get set }

Accesses the element with the specified identifier. - Note: Set `nil` to remove the element with matching identifier. - Parameter id: The identifier of the requested element.

subscript · iOS 18.0+

subscript

TypeScript
subscript65550(name: string): (IKRig_Constraint) | null
Swift declaration
subscript(name: String) -> IKRig.ConstraintsCollection.Element? { get set }

Accesses the element with the specified name. - Note: Set `nil` to remove the element with matching name. - Parameter name: The name of the requested element.

subscript · iOS 18.0+

subscript

TypeScript
subscript24754(position: number): IKRig_Constraint
Swift declaration
subscript(position: IKRig.ConstraintsCollection.Index) -> IKRig.ConstraintsCollection.Element { get set }

Accesses the element at the specified position. The following example accesses an element of an array through its subscript to print its value: var streets = ["Adams", "Bryant", "Channing", "Douglas", "Evarts"] print(streets[1]) // Prints "Bryant" You can subscript a collection with any valid index other than the collection's end index. The end index refers to the position one past the last element of a collection, so it doesn't correspond with an element. - Parameter position: The position of the element to access. `position` must be a valid index of the collection that is not equal to the `endIndex` property. - Complexity: O(1)

init · iOS 18.0+

init

TypeScript
static init(elements: Array<IKRig_Constraint>): IKRig_ConstraintsCollection
Swift declaration
init(_ elements: [IKRig.ConstraintsCollection.Element])

Creates a collection with the provided constraints. - Param elements: The array of constraints in the new collection.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

IKRig.ConstraintsCollection.init(arrayLiteral:)

A variable number of Swift arguments is not supported.

All RealityFoundation types →