Skip to content

User-friendly names for HealthKit workout type cases, incl. iOS 16

License

Notifications You must be signed in to change notification settings

dkasaj/HKWorkoutActivityType-Name

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

HKWorkoutActivityType-Name

User-friendly names for HealthKit workout type cases, incl. iOS 16

Apple's HealhKit defines workout types as enum cases, and does not provide any String-based values for their names.

This extension of HKWorkoutActivityType fixes it by defining a property

var displayName: String

that covers all cases up to iOS 16, listed in the same order as the official documentation lists cases, by section.

Usage

Add HKWorkoutActivityType.swift to your project and simply access workout.displayName property

Future updates

I expect to update the file with any new enum cases that come up in future iOS betas. Feel free to open an issue or a pull request if I weren't fast enough for you.

About

User-friendly names for HealthKit workout type cases, incl. iOS 16

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages