One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

SampledAnimation

struct · iOS 15.0+ · SDK 27.1

struct SampledAnimation<Value> where Value : AnimatableData

An animation that cycles through a series of frames at a constant interval. To specify the data that the animation samples, set one of the `frames` properties that matches the animated property's type. For example, set the ``SampledAnimation/frames-2j4nj`` property to interpolate <doc://com.apple.documentation/documentation/swift/float> values. The following code designates a ``SampledAnimation`` to animate a propery of type <doc://com.apple.documentation/documentation/swift/float> by specifying the generic typed syntax. The code queues an array of values: `1.0`, `2.0`, and `3.0`. ```swift // Define the animation type. typealias SampledAnimationType = SampledAnimation<Float> // Define the animated property values. let frameArray: [Float] = [1.0, 2.0, 3.0] ``` To determine how fast the animation progresses from frame to frame, define this structure's ``SampledAnimation/frameInterval`` property. The following code specifies a one-second delay between value changes before initializing the animation object. ```swift // Define a one-second frame interval. let interval: TimeInterval = 1 // Create the animation. let sampleAnim = SampledAnimationType( frames: frameArray, name: "sampledAnim1", frameInterval: interval isAdditive: true, bindTarget: .transform, blendLayer: 100, repeatMode: .autoReverse, fillMode: .backwards, trimStart: 1.0, trimEnd: 10.0, trimDuration: 9.0, offset: 2.0, delay: 1.0, speed: 2.0 ) ```

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →