Skip to content

benrudhart/WorkoutEffortPicker

Repository files navigation

WorkoutEffortPicker

Offers a drop-in SwiftUI component for Apple’s missing HealthKit effort score picker. As of iOS 18 and watchOS 11, Apple provides an API to read and write the effort of a HealthKit Workout, but doesn’t include a UI component for users to select a value. This library fills that gap.

iOS Demo watchOS Demo
iOS Demo watchOS Demo

Features

  • UI/UX that closely mimics Apple’s native design on watchOS/iOS
  • Simplified HKHealthStore APIs to fetch and save effort scores for workouts
  • Localized in 40 languages
  • Ready-to-use UI component: WorkoutEffortCell: A cell for displaying effort scores in workout summaries. The cell presents the following views as also seen in Apple's apps:
    • A horizontal picker for selecting the effort
    • A vertical picker alternative for selecting the effort

Requirements

iOS 18.0+ or watchOS 11.0+ (but the package can be imported into projects that support older OS versions)

How To

  • Add this library as a SPM to your project
  • Add import WorkoutEffortPicker in your view
  • Add the WorkoutEffortCell to your workout summary (or any other view)

Demo

Check out the included demo app to see the components in action. The demo showcases all available UI components and demonstrates how to integrate with HealthKit.

How Apple Showcases the Feature

Apple showcasing the workout effort picker

About

A drop-in SwiftUI component for Apple’s missing HealthKit effort score picker

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages