One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

AnimationGroup

struct · iOS 15.0+ · SDK 27.1

struct AnimationGroup

A collection of animations that play simultaneously. This structure concurrently starts the animations it contains. Use a group to: - Animate more than one property at once. - Animate the same property at different times. ### Animate multiple properties concurrently For each animatable property your animation needs to control, create a group and add an animation to the array argument of the initializer. The following listing begins coding an animation group that colorizes 3D numbers that count down over a 4-second duration. ```swift let frames: [Float] = [3.0, 2.0, 1.0, 0.0] let duration = TimeInterval(frames.count) let anim1 = FromToByAnimation<Float>(name: "colorize", from: 0.0, to: 1.0, duration: duration, bindTarget: .parameter("foo")) let anim2 = SampledAnimation<Float>(frames: frames, name: "count down", frameInterval: duration / frames.count, bindTarget: .parameter("bar")) let group = AnimationGroup(group: [anim1, anim2], name: "group") ``` ### Create a sequence for the same animation You can play the same animation at different times by grouping multiple ``AnimationDefinition`` objects that refer to the same animated property. To disperse their playback at runtime, give each definition a unique ``AnimationDefinition/delay``. - Important: The framework processes animations with a lower ``AnimationGroup/blendLayer`` first, and if the ``AnimationGroup/blendLayer`` matches, in the order in which they appear in the groups array. If two animations on the same property overlap durations at runtime, the one that the framework processes second overwrites the first.

Members (28)

get · iOS 15.0+

bindTarget

TypeScript
get bindTarget(): BindTarget
Swift declaration
var bindTarget: BindTarget { get set }

A textual name that refers to a property on which to run the grouped animations.

set · iOS 15.0+

bindTarget

TypeScript
set bindTarget(value: BindTarget)
Swift declaration
var bindTarget: BindTarget { get set }

A textual name that refers to a property on which to run the grouped animations.

get · iOS 15.0+

blendLayer

TypeScript
get blendLayer(): number
Swift declaration
var blendLayer: Int32 { get set }

The order in which the framework composites the animation. The framework applies multiple animations on the same target in ascending order of this property’s value. Animations in a lower layer run before animations in a higher layer. Animations that share the same value apply in the order they execute.

set · iOS 15.0+

blendLayer

TypeScript
set blendLayer(value: number)
Swift declaration
var blendLayer: Int32 { get set }

The order in which the framework composites the animation. The framework applies multiple animations on the same target in ascending order of this property’s value. Animations in a lower layer run before animations in a higher layer. Animations that share the same value apply in the order they execute.

get · iOS 15.0+

repeatMode

TypeScript
get repeatMode(): AnimationRepeatMode
Swift declaration
var repeatMode: AnimationRepeatMode { get set }

An option that determines how the animations repeat. If you call ``FromToByAnimation/trimmed(start:end:duration:)`` with a `start` or `end` that lies outside of the timeline defined by ``AnimationGroup/duration``, the animation fills the additional playback by applying this property.

set · iOS 15.0+

repeatMode

TypeScript
set repeatMode(value: AnimationRepeatMode)
Swift declaration
var repeatMode: AnimationRepeatMode { get set }

An option that determines how the animations repeat. If you call ``FromToByAnimation/trimmed(start:end:duration:)`` with a `start` or `end` that lies outside of the timeline defined by ``AnimationGroup/duration``, the animation fills the additional playback by applying this property.

get · iOS 15.0+

trimDuration

TypeScript
get trimDuration(): (number) | null
Swift declaration
var trimDuration: TimeInterval? { get set }

An optional duration that overrides the calculated duration. The framework calculates ``FromToByAnimation/duration``, but you can set this property to override it. This property is `nil` by default, which indicates that the animation stops after one play that spans ``AnimationGroup/duration``. If you set a non-zero value for this property and both ``AnimationGroup/trimStart`` and ``AnimationGroup/trimEnd`` are `nil`, the animation observes this property as an edited duration. When you set ``AnimationGroup/repeatMode`` to make the animation repeat: - If this property is `nil`, the animation repeats forever. - If set to a value greater than ``AnimationGroup/duration``, the animation repeats for the specified duration.

set · iOS 15.0+

trimDuration

TypeScript
set trimDuration(value: (number) | null)
Swift declaration
var trimDuration: TimeInterval? { get set }

An optional duration that overrides the calculated duration. The framework calculates ``FromToByAnimation/duration``, but you can set this property to override it. This property is `nil` by default, which indicates that the animation stops after one play that spans ``AnimationGroup/duration``. If you set a non-zero value for this property and both ``AnimationGroup/trimStart`` and ``AnimationGroup/trimEnd`` are `nil`, the animation observes this property as an edited duration. When you set ``AnimationGroup/repeatMode`` to make the animation repeat: - If this property is `nil`, the animation repeats forever. - If set to a value greater than ``AnimationGroup/duration``, the animation repeats for the specified duration.

get · iOS 15.0+

name

TypeScript
get name(): string
Swift declaration
var name: String { get set }

A textual name for the group.

set · iOS 15.0+

name

TypeScript
set name(value: string)
Swift declaration
var name: String { get set }

A textual name for the group.

get · iOS 15.0+

delay

TypeScript
get delay(): number
Swift declaration
var delay: TimeInterval { get set }

An amount of time that lapses before the animation plays. The default value is `0`, which indicates that the animation plays with no delay. If you set a value for this property, the animation plays from its start time after the specified delay lapses. During the delayed time, the animation doesn't update. However, to fill the delayed time with some portion of animation, set a negative ``AnimationGroup/trimStart`` instead and choose a ``OrbitAnimation/fillMode`` that displays the desired portion of animation.

set · iOS 15.0+

delay

TypeScript
set delay(value: number)
Swift declaration
var delay: TimeInterval { get set }

An amount of time that lapses before the animation plays. The default value is `0`, which indicates that the animation plays with no delay. If you set a value for this property, the animation plays from its start time after the specified delay lapses. During the delayed time, the animation doesn't update. However, to fill the delayed time with some portion of animation, set a negative ``AnimationGroup/trimStart`` instead and choose a ``OrbitAnimation/fillMode`` that displays the desired portion of animation.

init · iOS 15.0+

init

TypeScript
static init(group: Array<SDKHandle>, name?: string, repeatMode?: AnimationRepeatMode, fillMode?: AnimationFillMode, trimStart?: (number) | null, trimEnd?: (number) | null, trimDuration?: (number) | null, offset?: number, delay?: number, speed?: number): AnimationGroup
Swift declaration
init(group: [any AnimationDefinition], name: String = "", repeatMode: AnimationRepeatMode = .none, fillMode: AnimationFillMode = [], trimStart: TimeInterval? = nil, trimEnd: TimeInterval? = nil, trimDuration: TimeInterval? = nil, offset: TimeInterval = 0, delay: TimeInterval = 0, speed: Float = 1.0)

Creates a collection of animations that play simultaneously. - Parameters: - group: A collection of animations to run. - name: A textual name for the group. - repeatMode: An option that determines how the animations repeat. - fillMode: The playback behavior outside of the normal duration. - trimStart: The time, in seconds, at which the animations play. - trimEnd: The time, in seconds, at which the animations stop. - trimDuration: An optional duration that overrides the calculated duration. - offset: The time, in seconds, at which the animation begins within the duration. - delay: An amount of time that lapses before the animation plays. - speed: A factor that increases or decreases the animation’s rate of playback.

get · iOS 15.0+

group

TypeScript
get group(): Array<SDKHandle>
Swift declaration
var group: [any AnimationDefinition] { get set }

A collection of animations to run.

set · iOS 15.0+

group

TypeScript
set group(value: Array<SDKHandle>)
Swift declaration
var group: [any AnimationDefinition] { get set }

A collection of animations to run.

get · iOS 15.0+

speed

TypeScript
get speed(): number
Swift declaration
var speed: Float { get set }

A factor that increases or decreases the animation's rate of playback. The default value is `1.0`, which doesn’t alter the animation’s duration. A value of `2.0` indicates that the duration is half the normal rate. A value of `0.5` indicates that the duration is twice the normal rate. Negative values play the animation in reverse. This property doesn’t affect the animation’s ``FromToByAnimation/delay``.

set · iOS 15.0+

speed

TypeScript
set speed(value: number)
Swift declaration
var speed: Float { get set }

A factor that increases or decreases the animation's rate of playback. The default value is `1.0`, which doesn’t alter the animation’s duration. A value of `2.0` indicates that the duration is half the normal rate. A value of `0.5` indicates that the duration is twice the normal rate. Negative values play the animation in reverse. This property doesn’t affect the animation’s ``FromToByAnimation/delay``.

get · iOS 15.0+

offset

TypeScript
get offset(): number
Swift declaration
var offset: TimeInterval { get set }

The time, in seconds, at which the animations begin within the duration. The default value is `0`, which indicates that the animation plays with no offset. Setting a value for this property moves the animation data along the timeline and doesn't change timing. If you set a ``AnimationGroup/fillMode`` other than ``AnimationFillMode/none``, the animation fills the vacant area created by the offset according to the characteristics of the specified fill mode.

set · iOS 15.0+

offset

TypeScript
set offset(value: number)
Swift declaration
var offset: TimeInterval { get set }

The time, in seconds, at which the animations begin within the duration. The default value is `0`, which indicates that the animation plays with no offset. Setting a value for this property moves the animation data along the timeline and doesn't change timing. If you set a ``AnimationGroup/fillMode`` other than ``AnimationFillMode/none``, the animation fills the vacant area created by the offset according to the characteristics of the specified fill mode.

get · iOS 15.0+

trimEnd

TypeScript
get trimEnd(): (number) | null
Swift declaration
var trimEnd: TimeInterval? { get set }

The time, in seconds, at which the animations stop. This property is `nil` by default, which plays the animation until `time` = ``AnimationGroup/duration``. If you set a value, the animation edits the duration according to the specified ending time.

set · iOS 15.0+

trimEnd

TypeScript
set trimEnd(value: (number) | null)
Swift declaration
var trimEnd: TimeInterval? { get set }

The time, in seconds, at which the animations stop. This property is `nil` by default, which plays the animation until `time` = ``AnimationGroup/duration``. If you set a value, the animation edits the duration according to the specified ending time.

get · iOS 15.0+

additive

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

A Boolean value that indicates whether the animation builds on the current state of the target entity or resets the state before running.

set · iOS 15.0+

additive

TypeScript
set additive(value: boolean)
Swift declaration
var additive: Bool { get set }

A Boolean value that indicates whether the animation builds on the current state of the target entity or resets the state before running.

get · iOS 15.0+

duration

TypeScript
get duration(): number
Swift declaration
var duration: TimeInterval { get }

The total playback time of the animation. The framework sets a value for this property depending on the underlying animation data and the specified ``AnimationGroup/speed``. You can override the default duration by defining ``AnimationGroup/trimStart``, ``AnimationGroup/trimEnd``, or ``AnimationGroup/trimDuration``.

get · iOS 15.0+

fillMode

TypeScript
get fillMode(): AnimationFillMode
Swift declaration
var fillMode: AnimationFillMode { get set }

An option that determines which data displays outside of the normal duration. This property determines what to display when the framework samples the animation outside of the range defined by its underlying duration. The animation applies this property when: - Playback progresses toward, but hasn't yet reached, a nonzero ``AnimationDefinition/offset``. - A range determined by ``AnimationDefinition/trimStart``, ``AnimationDefinition/trimEnd``, or ``AnimationDefinition/trimDuration`` exceeds the animation's underlying duration.

set · iOS 15.0+

fillMode

TypeScript
set fillMode(value: AnimationFillMode)
Swift declaration
var fillMode: AnimationFillMode { get set }

An option that determines which data displays outside of the normal duration. This property determines what to display when the framework samples the animation outside of the range defined by its underlying duration. The animation applies this property when: - Playback progresses toward, but hasn't yet reached, a nonzero ``AnimationDefinition/offset``. - A range determined by ``AnimationDefinition/trimStart``, ``AnimationDefinition/trimEnd``, or ``AnimationDefinition/trimDuration`` exceeds the animation's underlying duration.

get · iOS 15.0+

trimStart

TypeScript
get trimStart(): (number) | null
Swift declaration
var trimStart: TimeInterval? { get set }

The time, in seconds, at which the animations play. This property is `nil` by default, which plays the animation with `time` = `0`. If you set a value, the animation edits the duration according to the specified beginning time. If you set a negative value for this property, the duration increases and the additional animation data fills in based on the ``AnimationView/fillMode`` you choose.

set · iOS 15.0+

trimStart

TypeScript
set trimStart(value: (number) | null)
Swift declaration
var trimStart: TimeInterval? { get set }

The time, in seconds, at which the animations play. This property is `nil` by default, which plays the animation with `time` = `0`. If you set a value, the animation edits the duration according to the specified beginning time. If you set a negative value for this property, the duration increases and the additional animation data fills in based on the ``AnimationView/fillMode`` you choose.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →