swift-health-kit

Guide HealthKit setup, data saving, and querying in Swift apps.

16|2|Updated Jan 1, 2026
One-click install
npx skills add https://github.com/nonameplum/agent-skills --skill swift-health-kit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swift-health-kit
Source: https://github.com/nonameplum/agent-skills/tree/main/swift-health-kit
Command: npx skills add https://github.com/nonameplum/agent-skills --skill swift-health-kit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

HealthKit integration in apps requires understanding entitlements, privacy controls, and data access patterns. This Skill consolidates setup, authorization, and usage guidance to streamline compliant HealthKit development.

Core Features & Use Cases

  • Setup guidance: enable HealthKit capability, request proper Info.plist keys, and verify device compatibility.
  • Data access patterns: read and write HealthKit data using HKHealthStore and the various type classes (HKQuantityType, HKCategoryType, HKCorrelation).
  • Privacy & compliance: implement per-type permission handling, privacy prompts, and guest user considerations on visionOS.
  • Real-world workflows: saving workout data, querying samples, and background delivery for updates.
  • Use Case: build a health-tracking app that records steps and workouts and shows them in the Health app.

Quick Start

Activate HealthKit in your project, verify availability with isHealthDataAvailable(), instantiate HKHealthStore, and request access to needed data types.

Frequently Asked Questions about swift-health-kit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up HealthKit authorization in my Swift app?

To set up HealthKit authorization, enable the HealthKit capability in your project, add the required Info.plist privacy keys, verify device compatibility with isHealthDataAvailable(), and instantiate HKHealthStore to request per-type access. This ensures compliant data access for your app.

Can I read and write health samples like workouts and steps using HealthKit?

Yes, you can read and write health samples using HKHealthStore and type classes like HKQuantityType, HKCategoryType, and HKCorrelation. This allows your app to save workout data, query step samples, and display recorded health information in the Apple Health app.

Does HealthKit work with SwiftUI and across Apple platforms?

HealthKit works across iPhone, Apple Watch, iPad, and visionOS apps. The Skill provides SwiftUI integration patterns to ensure reliable HealthKit usage, covering API usage, sample types, and specific considerations like guest user handling on visionOS.

How do I handle background delivery for HealthKit data updates?

Background delivery for HealthKit updates is handled by configuring queries through HKHealthStore. This allows your app to receive updates and query health samples in the background, ensuring reliable and compliant health data tracking.

What are the privacy requirements for accessing HealthKit data?

Privacy requirements for accessing HealthKit data include implementing per-type permission handling and providing proper privacy prompts. You must request specific authorization for each data type and verify availability before accessing sensitive health information.