HKWorkoutEventType.lap
A constant indicating a lap.
Declaration
case lapMentioned in
Discussion
Lap events partition a workout into segments of equal distance (for example, laps around a track or laps in a pool). The lap’s dateInterval property should mark the start and end of the lap. Lap events can’t overlap.
When you receive lap events from the HealthKit store, examine the event’s dateInterval property to interpret the lap correctly:
Zero-duration intervals. Older lap events (created before iOS 11 and watchOS 4) have a zero-duration date interval that marks the end of the lap. Each lap is assumed to start when the previous lap ends, and laps fill the entire workout completely.****
Nonzero-duration intervals. Newer lap events use the date interval to mark the start and the duration of the lap. These events have a nonzero duration, and they do not need to fill the workout; however, you should ideally mark any rest periods between laps using HKWorkoutEventType.pause and HKWorkoutEventType.resume events.