Closed piscoTech closed 7 years ago
I've removed the limitation on which workout types are loaded: now all workout will be loaded as simple one, i.e. with only type, start, end, duration, heart rate, and, when available distance, pace and speed; detailed workouts (for now only running and swimming) need to declare their own subclass to specify how to load details. Workout type name is now based on the cases of the HKWorkoutActivityType
enum to be as accurate as possible.
Only concern left is if distance sample for swimming workout are linked to their workout thus loading the searching by workout and not by time, but I'm pretty sure it's like this as Apple documentation states that distance data should be linked to the workout to match its total distance.
@standel Now swimming workout displays distance in meter and speed in km/h (pace I think is not relevant but set to time per kilometer). Also are speed, heart rate and number of strokes enough details for the minute-by-minute break up of data (we can set at most four details as we have limited width and the fourth slot is for time)?
Thanks for the feedback, expect an update next week
Refactor workout classes to allow loading of arbitrary workout types and easy extendibility based on what proposed in #1.
This include support for swimming workout (
HKWorkoutActivityType.swimming
) and lifting (HKWorkoutActivityType.functionalStrengthTraining
). As additional details for swimming workouts are available only on iOS 10 and later on older versions a swimming workout will behave like a simple one without any detail.To do list: