Today, IntervalBlock only supports a fixed iteration count:
IntervalBlock(steps: [IntervalStep], iterations: Int)
This works well when the athlete knows exactly how many rounds they want to perform, but a lot of structured running and cycling workouts terminate a repeating block based on cumulative distance or cumulative elapsed time instead.
These constructs are first-class on Garmin Connect, TrainingPeaks, FinalSurge, and similar platforms, but there's no way to express them in WorkoutKit's CustomWorkout.
We've had to either fall back to a fixed iteration count (which forces us to guess the user's pace) or skip Apple Workout scheduling for these workouts entirely, which is a poor experience for athletes on watchOS.
Proposal:
// Today (still supported)
IntervalBlock(steps: steps, iterations: 5)
// Proposed
IntervalBlock(steps: steps, until: .distance(5, .kilometers))
IntervalBlock(steps: steps, until: .time(30, .minutes))
IntervalBlock(steps: steps, iterations: 8) // unchanged
Example Workouts with proposed features:
- "Run/walk until 5 km"
Run for a minute, then walk for 30 seconds until completing a 5K.
- "30-minute fartlek"
Repeat a hard/easy pair until cumulative time hits 30 min
- "10 km tempo with surges"
Surge/recover until total distance hits 10 km.
FB: FB23359408