Animation

public protocol Animation: Advanceable

A protocol which defines the basic requirements to function as a time-advancable animation.

Conforming types can be used to animate values.

  • The type of value to be animated.

    Declaration

    Swift

    associatedtype Value: VectorConvertible
  • Returns true if the animation has completed.

    Declaration

    Swift

    var isFinished: Bool
  • The current value of the animation.

    Declaration

    Swift

    var value: Value
  • The current velocity of the animation. This can be used to achieve seamless transitions between animations. For example, a running spring animation may be interrupted and replaced by a decay animation. The velocity of the spring at the time it is interrupted can be used as the initial velocity of the decay animation to produce fluid, continuous motion.

    Declaration

    Swift

    var velocity: Value
  • allValues(timeStep:) Extension method

    Returns a sequence containing discrete values for the duration of the animation, based on the provided time step.

    Declaration

    Swift

    public func allValues(timeStep: Double = 0.008) -> AnySequence<Value>