One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

AnimationFillMode

struct · iOS 15.0+ · SDK 27.1

struct AnimationFillMode

Options that determine which animation frames display outside of the normal duration. This structure enables you to lock an animation at its starting frame for a period of time before beginning. You can also lock an animation to its ending frame for a specified amount of time after it finishes, or both. An animation applies the fill mode you choose when a range determined by ``AnimationView/trimStart``, ``AnimationView/trimEnd``, or ``AnimationView/trimDuration`` exceeds the animation's underlying duration, which the framework calculates as the frame count (see ``SampledAnimation/frames-2j4nj``) multiplied by the ``SampledAnimation/frameInterval``, multiplied by ``AnimationDefinition/speed``. For example, if you set the ``AnimationDefinition/trimStart`` property for an animation of a hand waving to `-1.0` and ``SampledAnimation/fillMode`` to ``AnimationFillMode/backwards`` or ``AnimationFillMode/both``, the hand displays immediately, freezes at the first animation frame for one second, and then begins to wave.

Members (6)

get · iOS 15.0+

both

TypeScript
get both(): AnimationFillMode
Swift declaration
static let both: AnimationFillMode

An option that displays the animation's initial frame or final frame when playback occurs outside of the normal duration. For example, if you extend a hand-waving animation’s duration by one second in both directions by setting ``SampledAnimation/trimStart`` to `-1.0`, and ``SampledAnimation/trimEnd`` to ``SampledAnimation/duration`` + `1.0`, a ``SampledAnimation/fillMode`` of `both` determines that the hand holds its initial appearance for one second before continuing to wave. Then, the animation freezes on its final hand-waving frame for one second before disappearing.

get · iOS 15.0+

none

TypeScript
get none(): AnimationFillMode
Swift declaration
static let none: AnimationFillMode

An option that indicates an animation doesn't display frame data outside of its normal duration. For example, if you rewind an animation of a hand waving for one second by setting ``SampledAnimation/trimStart`` to `-1.0`, a ``SampledAnimation/fillMode`` of `none` determines that the hand is invisible for one second before appearing and waving.

get · iOS 15.0+

forwards

TypeScript
get forwards(): AnimationFillMode
Swift declaration
static let forwards: AnimationFillMode

An option that freezes the last frame of the animation until it stops. For example, if you increase a hand-waving animation’s duration one second by setting ``SampledAnimation/trimEnd`` to ``SampledAnimation/duration`` + `1.0`, a ``SampledAnimation/fillMode`` of `forwards` determines that the hand waves and then freezes on its final animation frame for one second before disappearing.

init · iOS 15.0+

init

TypeScript
init(rawValue: number): AnimationFillMode
Swift declaration
init(rawValue: Int8)

Creates a fill mode from its backing data type. Use this initializer to unarchive a fill mode from data: ```swift let rawValue = unarchiveNextInt8(from: data) // Pseudo code. let fillMode = AnimationFillMode(rawValue: rawValue) ``` - Parameters: - rawValue: The backing data value for the fill mode.

get · iOS 15.0+

rawValue

TypeScript
getRawValue($self: AnimationFillMode): number
Swift declaration
let rawValue: Int8

The corresponding value of the raw type. A new instance initialized with `rawValue` will be equivalent to this instance. For example: enum PaperSize: String { case A4, A5, Letter, Legal } let selectedSize = PaperSize.Letter print(selectedSize.rawValue) // Prints "Letter" print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!) // Prints "true"

get · iOS 15.0+

backwards

TypeScript
get backwards(): AnimationFillMode
Swift declaration
static let backwards: AnimationFillMode

An option that shows the first animation frame while playback progresses to the beginning position. For example, if you wind a hand-waving animation’s duration back one second by setting ``SampledAnimation/trimStart`` to `-1.0`, a ``SampledAnimation/fillMode`` of `backwards` determines that the hand holds its initial appearance for one second before waving.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →