duration
The workout’s duration.
Declaration
var duration: TimeInterval { get }Mentioned in
Discussion
A workout’s duration can be specified in one of three ways. The init(activityType:start:end:) method uses the time interval between the provided start and end dates. The init(activityType:start:end:duration:totalEnergyBurned:totalDistance:metadata:) method sets the duration to the provided value. And the init(activityType:start:end:workoutEvents:totalEnergyBurned:totalDistance:metadata:) method calculates the total active duration based on the start and end dates and the workout events.