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-code

Installs 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

Project Configuration

  1. Enable the HealthKit capability in Xcode (adds the entitlement)
  2. Add NSHealthShareUsageDescription (read) and NSHealthUpdateUsageDescription (write) to Info.plist
  3. 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

Recommended

More Security
1yaklang avatarwaf-bypass-techniquesyaklang/hack-skillsWAF bypass methodology and generic evasion techniques. Use when a web application firewall blocks injection payloads (SQLi, XSS, RCE) and you need to craft bypa4Kskills.sh installs
2forcedotcom avatargenerating-permission-setforcedotcom/sf-skillsGenerates correct, deployable Salesforce permission set metadata (PermissionSet XML) with object, field, user, and app permissions. Use this skill when creating4Kskills.sh installs
3dotnet avatartest-taggingdotnet/skillsAnalyzes test suites in any language and tags each test with standardized traits (positive, negative, critical-path, boundary, smoke, regression, integration, p4Kskills.sh installs
4yaklang avatarkubernetes-pentestingyaklang/hack-skillsKubernetes penetration testing playbook. Use when targeting Kubernetes clusters via API server, RBAC enumeration, service account abuse, etcd access, Kubelet AP3.9Kskills.sh installs
5forcedotcom avatargenerating-lightning-appforcedotcom/sf-skillsBuild complete Salesforce Lightning Experience applications from natural language descriptions. Use this skill when a user requests a "complete app", "Lightning3.9Kskills.sh installs
6yaklang avatarios-pentesting-tricksyaklang/hack-skillsiOS pentesting playbook. Use when testing iOS applications for keychain extraction, URL scheme hijacking, Universal Links exploitation, runtime manipulation, bi3.9Kskills.sh installs