SChartTimeProgressCalculator

@interface SChartTimeProgressCalculator
    : NSObject <SChartProgressCalculator, NSCopying>

Calculates a progress value based on time.

It uses the duration time value its initialised with to calculate a progress value. The calculator records a start time when we call the progress method for first time and will produce a progress value of 0 at this point. The progress value will be 1 when the current time equals the start time the calculator recorded + the duration.

  • Constructs a time calculator with a duration.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDuration:(double)duration;

    Swift

    init(duration: Double)

    Parameters

    duration

    The time in seconds from the start time when the progress value equals 1.

    Return Value

    A progress calculator based on time.