init(activity:location:displayName:warmup:blocks:cooldown:)
Create a new custom workout.
Declaration
init(activity: HKWorkoutActivityType, location: HKWorkoutSessionLocationType = .unknown, displayName: String? = nil, warmup: WorkoutStep? = nil, blocks: [IntervalBlock] = [], cooldown: WorkoutStep? = nil)Parameters
- activity:
The type of activity performed during the workout.
- location:
The workout session location for the workout.
- displayName:
The name that the system uses when displaying the workout.
- warmup:
The warmup step (if any).
- blocks:
A block of repeating work and recovery steps.
- cooldown:
The cooldown step (if any).