The workout’s duration.
SDKs
- iOS 8.0+
- Mac Catalyst 13.0+
- watchOS 2.0+
Framework
- Health
Kit
Declaration
var duration: Time Interval { get }
Discussion
A workout’s duration can be specified in one of three ways. The init(activity
method uses the time interval between the provided start and end dates. The init(activity
method sets the duration to the provided value. And the init(activity
method calculates the total active duration based on the start and end dates and the workout events.