Proportional

open class Proportional: Duration

Proportional** is a subclass of Duration that acts as an abstraction for a duration that is proportional to some base absolute-time interval. The lastInterval property reflects the most recent absolute-time interval represented by an instance.

  • The underlying base absolute-time interval which is scaled.

    Declaration

    Swift

    public var baseSeconds: TimeInterval = 1.0
  • Initialize from a base absolute-time interval, also setting the lastInterval property to this interval initially.

    Declaration

    Swift

    public init(baseInterval: TimeInterval)
  • Initialize from a base absolute-time interval and an initial scaling factor.

    Declaration

    Swift

    public init(baseInterval: TimeInterval, scalingFactor: Double)
  • Rescale the current instance’s lastInterval property. Also returns the new absolute-time interval, which can be discarded.

    Declaration

    Swift

    public func scale(by scalingFactor: Double) -> TimeInterval