
Healthkit
This is a comprehensive reference for working with Apple's HealthKit framework in Swift 6.3 and iOS 26+. It covers the full lifecycle: checking availability, requesting authorization the right way (important for App Review), querying samples with the modern descriptor API, pulling statistics for aggregated data, and building time-series collections for charts. You also get practical guidance on writing samples, setting up background delivery so your app wakes when new data arrives, and recording workouts with HKWorkoutSession. The common mistakes section and unit reference tables are genuinely useful. If you're building anything that touches Apple Health data, whether it's displaying step counts, logging workouts, or syncing vitals in the background, this gives you the patterns you need without having to piece together Apple's scattered documentation.
- skills.sh installs
- 4K
- GitHub stars
- 1.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add dpearson2699/swift-ios-skills --skill healthkit --agent claude-codeInstalls into .claude/skills of the current project.
Files
HealthKit
Read and write health and fitness data from the Apple Health store. Covers authorization, queries, writing samples, background delivery, and workout sessions. Targets Swift 6.3 / iOS 26+.
Contents
- Setup and Availability
- Authorization
- Reading Data: Sample Queries
- Reading Data: Statistics Queries
- Reading Data: Statistics Collection Queries
- Writing Data
- Background Delivery
- Workout Sessions
- Common Data Types
- HKUnit Reference
- Common Mistakes
- Review Checklist
- References
Setup and Availability
Project Configuration
- Enable the HealthKit capability in Xcode (adds the entitlement)
- Add
NSHealthShareUsageDescription(read) andNSHealthUpdateUsageDescription(write) to Info.plist - For background delivery, enable the "Background Delivery" sub-capability
Availability Check
Sponsors
Details
- Repository
- github.com/dpearson2699/swift-ios-skills
- Categories
- Security, Data Science & ML, Mobile Development, Video & Audio Editing
- First seen
- Apr 16, 2026
More from dpearson2699/swift-ios-skills
All 98- Vision Framework4K
- Coreml3.9K
- Core Bluetooth3.9K
- Core Motion3.8K
- Natural Language3.8K
- Speech Recognition3.8K
- Device Integrity3.8K
- Contacts Framework3.8K
- Alarmkit3.8K
- Core Nfc3.8K
- Swift Codable3.8K
- Tipkit3.8K
- App Clips3.8K
- Permissionkit3.7K
- Energykit3.7K
- Shareplay Activities3.7K
- Weatherkit3.6K
- Activitykit3.5K
- Cloudkit3.5K
- Photokit3.4K
- Mapkit3.4K
- Swiftui Webkit3.4K
- Realitykit3.4K
- Avkit3.4K