piscoTech / Workout

A simple iOS app that accesses Health data to export workout data to CSV for any use.
MIT License
43 stars 9 forks source link

Exporting Other Workout Types #3

Closed piscoTech closed 7 years ago

piscoTech commented 7 years ago

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:

piscoTech commented 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.

piscoTech commented 7 years ago

@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)?

piscoTech commented 7 years ago

Thanks for the feedback, expect an update next week