
I can get swimming distance data and swimming stroke count data.. But I can't get swimming pool length data.. How can I get the swimming pool length?
...
guard let distance = workout.statistics(for: .init(.distanceSwimming)),
let meter = distance.sumQuantity()?.doubleValue(for: HKUnit.meter()),
let sampleType = HKSampleType.quantityType(forIdentifier: .swimmingStrokeCount)
...
From here...
https://developer.apple.com/documentation/healthkit/hkmetadatakeyswimmingstrokestyle
It looks like there is a key
HKMetadataKeyLapLengththat would be the pool length.