What problem does it solve?
HealthKit integration lets mobile apps securely read and write Apple Health data needed for personalized health features, while handling authorization and device availability.
Core Features & Use Cases
- Read Health metrics via queries: Fetch recent samples and compute aggregated statistics such as daily step counts and time-series chart data.
- Write new Health samples: Save app-generated metrics using HKQuantitySample for metrics your app creates.
- Enable background updates and workouts: Register background delivery for updates and manage live workout tracking with HKWorkoutSession and HKLiveWorkoutBuilder.
- Use correct types and units: Apply appropriate HKQuantityTypeIdentifier values, HKCategoryType identifiers, and HKUnit conversions to ensure accurate results.
Quick Start
Use the healthkit skill to integrate HealthKit reads, statistics, background delivery, and workout session recording in your Swift (SwiftUI/iOS) app by following the setup and authorization steps first.