One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

Entity.ChildCollection

struct · iOS 13.0+ · SDK 27.1

@MainActor @preconcurrency struct ChildCollection

A collection of child entities.

Members (22)

method · iOS 13.0+

replaceAll

TypeScript
replaceAllPreservingWorldTransforms(children: Array<Entity>, preservingWorldTransforms?: boolean): Promise<void>
Swift declaration
@MainActor @preconcurrency func replaceAll(_ children: [Entity], preservingWorldTransforms: Bool = false)

Removes all children from this entity and adds the specified list of entities as the new children. - Parameters: - children: The list of the new children. - preservingWorldTransforms: `true` to preserve the world transform. `false` to preserve the relative transform. (Use `true` if the entities should keep its effective location and size in the scene!)

method · iOS 13.0+

replaceAll

TypeScript
replaceAllPreservingWorldTransforms69951(children: Array<Entity>, preservingWorldTransforms?: boolean): Promise<void>
Swift declaration
@MainActor @preconcurrency func replaceAll<S>(_ children: S, preservingWorldTransforms: Bool = false) where S : Sequence, S.Element : Entity

Removes all children from this entity and adds the specified list of entities as the new children. - Parameters: - children: The list of the new children. - preservingWorldTransforms: `true` to preserve the world transform. `false` to preserve the relative transform. (Use `true` if the entities should keep its effective location and size in the scene!)

method · iOS 18.0+

replaceAll

TypeScript
replaceAll(children: Array<Entity>): Promise<void>
Swift declaration
@MainActor @preconcurrency func replaceAll<S>(_ children: S) where S : Sequence, S.Element : Entity

Removes all children from this entity and adds the specified list of entities as the new children. - Parameters: - children: The list of the new children.

get · iOS 13.0+

startIndex

TypeScript
get startIndex(): Promise<number>
Swift declaration
@MainActor @preconcurrency var startIndex: Int { get }

The position of the first element in a nonempty collection. (See `Collection.startIndex`.)

get · iOS 13.0+

description

TypeScript
get description(): Promise<string>
Swift declaration
@MainActor @preconcurrency var description: String { get }

A textual representation of this instance. (See `CustomStringConvertible`.)

method · iOS 13.0+

makeIterator

TypeScript
makeIterator(): Promise<Entity_ChildCollection_IndexingIterator<Entity_ChildCollection>>
Swift declaration
@MainActor @preconcurrency func makeIterator() -> Entity.ChildCollection.Iterator

Returns an iterator over the elements of the collection.

method · iOS 13.0+

index

TypeScript
index(i: number): Promise<number>
Swift declaration
@MainActor @preconcurrency func index(after i: Int) -> Int

Returns the position immediately after the given index. (See `Collection.index`.)

method · iOS 13.0+

append

TypeScript
appendContentsOfPreservingWorldTransforms(children: Entity_ChildCollection, preservingWorldTransforms?: boolean): Promise<void>
Swift declaration
@MainActor @preconcurrency func append(contentsOf children: Entity.ChildCollection, preservingWorldTransforms: Bool = false)

Moves all `children` to be children of this entity. - Parameters: - children: The child entities to add to the collection. - preservingWorldTransforms: `true` to preserve the world transform. `false` to preserve the relative transform. (Use `true` if the entities should keep its effective location and size in the scene!)

method · iOS 13.0+

append

TypeScript
appendContentsOfPreservingWorldTransforms12861(array: Array<Entity>, preservingWorldTransforms?: boolean): Promise<void>
Swift declaration
@MainActor @preconcurrency func append(contentsOf array: [Entity], preservingWorldTransforms: Bool = false)

Adds the specified list of entity as children to this entity. - Parameters: - array: The child entities to add to the collection. - preservingWorldTransforms: `true` to preserve the world transform. `false` to preserve the relative transform. (Use `true` if the entities should keep its effective location and size in the scene!)

method · iOS 13.0+

append

TypeScript
appendContentsOfPreservingWorldTransforms91272(sequence: Array<Entity>, preservingWorldTransforms?: boolean): Promise<void>
Swift declaration
@MainActor @preconcurrency func append<S>(contentsOf sequence: S, preservingWorldTransforms: Bool = false) where S : Sequence, S.Element : Entity

Adds the specified list of entity as children to this entity. - Parameters: - sequence: The child entities to add to the collection. - preservingWorldTransforms: `true` to preserve the world transform. `false` to preserve the relative transform. (Use `true` if the entities should keep its effective location and size in the scene!)

method · iOS 18.0+

append

TypeScript
appendContentsOf(sequence: Array<Entity>): Promise<void>
Swift declaration
@MainActor @preconcurrency func append<S>(contentsOf sequence: S) where S : Sequence, S.Element : Entity

Adds the specified list of entity as children to this entity. - Parameters: - sequence: The child entities to add to the collection.

method · iOS 13.0+

append

TypeScript
appendPreservingWorldTransform(child: Entity, preservingWorldTransform?: boolean): Promise<void>
Swift declaration
@MainActor @preconcurrency func append(_ child: Entity, preservingWorldTransform: Bool = false)

Adds the specified entity as a child to this entity. - Parameters: - child: The child entity to add to the collection. - preservingWorldTransform: `true` to preserve the world transform. `false` to preserve the relative transform. (Use `true` if the model should keep its effective location and size in the scene!)

method · iOS 18.0+

insert

TypeScript
insert(sequence: Array<Entity>, index: number): Promise<void>
Swift declaration
@MainActor @preconcurrency func insert<S>(contentsOf sequence: S, beforeIndex index: Int) where S : Sequence, S.Element : Entity

Adds the specified sequence of entities to this collection in order, directly before the entity at the given index. - Parameters: - sequence: A sequence of entities to add to the collection. - index: The index of an entity to insert in front of. If `endIndex` is provided, the entities will be appended. > Note: This operation can invalidate the index order of any extant entities.

method · iOS 13.0+

remove

TypeScript
removeAtPreservingWorldTransform(index: number, preservingWorldTransform?: boolean): Promise<void>
Swift declaration
@MainActor @preconcurrency func remove(at index: Int, preservingWorldTransform: Bool = false)

Removes the specified child from this entity. - Note: This may modify the order of the `ChildCollection`. - Parameters: - index: The index of the child entity to remove from the collection. - preservingWorldTransform: `true` to preserve the world transform. `false` to preserve the relative transform. (Use `true` if the entities should keep its effective location and size in the scene!)

method · iOS 18.0+

remove

TypeScript
removeAt(index: number): Promise<void>
Swift declaration
@MainActor @preconcurrency func remove(at index: Int)

Removes the specified child from this entity. - Parameters: - index: The index of the child entity to remove from the collection.

method · iOS 13.0+

remove

TypeScript
removePreservingWorldTransform(child: Entity, preservingWorldTransform?: boolean): Promise<void>
Swift declaration
@MainActor @preconcurrency func remove(_ child: Entity, preservingWorldTransform: Bool = false)

Removes the specified child from this entity. - Note: This may modify the order of the `ChildCollection`. - Parameters: - child: The child entity to remove from the collection. - preservingWorldTransform: `true` to preserve the world transform. `false` to preserve the relative transform. (Use `true` if the entities should keep its effective location and size in the scene!)

method · iOS 18.0+

remove

TypeScript
remove(child: Entity): Promise<void>
Swift declaration
@MainActor @preconcurrency func remove(_ child: Entity)

Removes the specified child from this entity. - Parameters: - child: The child entity to remove from the collection.

get · iOS 13.0+

endIndex

TypeScript
get endIndex(): Promise<number>
Swift declaration
@MainActor @preconcurrency var endIndex: Int { get }

TThe collection’s “past the end” position—that is, the position one greater than the last valid subscript argument. (See `Collection.endIndex`.)

method · iOS 13.0+

removeAll

TypeScript
removeAllKeepCapacityPreservingWorldTransforms(keepCapacity?: boolean, preservingWorldTransforms?: boolean): Promise<void>
Swift declaration
@MainActor @preconcurrency func removeAll(keepCapacity: Bool = false, preservingWorldTransforms: Bool = false)

Removes all children from this entity. - Parameters: - keepCapacity: `true` to keep the memory reserved for storing the children. `false` to free the reserved memory. - preservingWorldTransforms: `true` to preserve the world transform. `false` to preserve the relative transform. (Use `true` if the entities should keep its effective location and size in the scene!)

method · iOS 13.0+

removeAll

TypeScript
removeAllPreservingWorldTransforms(preservingWorldTransforms?: boolean): Promise<void>
Swift declaration
@MainActor @preconcurrency func removeAll(preservingWorldTransforms: Bool = false)
method · iOS 18.0+

removeAll

TypeScript
removeAll(): Promise<void>
Swift declaration
@MainActor @preconcurrency func removeAll()

Removes all children from this entity.

subscript · iOS 13.0+

subscript

TypeScript
subscript(index: number): Promise<Entity>
Swift declaration
@MainActor @preconcurrency subscript(index: Int) -> Entity { get set }

Accesses the element at the specified position. (See `Collection.subscript`.)

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →