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.2 / iOS 26+.
Always check availability before accessing HealthKit. iPad and some devices do not support it.
Create a single HKHealthStore instance and reuse it throughout your app. It is thread-safe.
HealthKit을 사용하여 Apple 건강 데이터를 읽고, 쓰고, 쿼리합니다. HKHealthStore 인증, 샘플 쿼리, 통계 쿼리, 차트에 대한 통계 수집 쿼리, HKQuantitySample 데이터 저장, 백그라운드 전달, HKWorkoutSession 및 HKLiveWorkoutBuilder, HKUnit 및 HKQuantityTypeIdentifier 값을 사용한 운동 세션을 다룹니다. Apple 건강과 통합하고, 건강 지표를 표시하고, 운동을 기록하거나, 백그라운드 건강 데이터 전달을 활성화할 때 사용합니다. 출처: dpearson2699/swift-ios-skills.