Spring

public final class Spring<T: VectorConvertible>

Animates changes to a value using spring physics.

Instances of Spring should be used in situations where spring physics are the only animation type required, or when convenient access to the properties of a running spring simulation is needed.

The focused API of this class makes it more convenient in such cases than using an Animatable instance, where a new spring animation would have to be added each time the spring needed to be modified.

let s = Spring(value: CGPoint.zero)

s.changed.observe { (value) in
  // do something with the value when it changes
}

s.target = CGPoint(x: 100.0, y: 200.0)
// Off it goes!