HKHealthStore
The access point for all data managed by HealthKit.
Declaration
class HKHealthStoreMentioned in
Overview
Use a HKHealthStore object to request permission to share or read HealthKit data. People can grant your app full access to a data type, limited access restricted to a recent window of data, or no access at all. After requesting authorization, you can check the scope of your read access for specific data types before making queries. You can also use the HealthKit store to save new samples to the store, manage the samples that your app saves, and start, stop, and manage queries.
For more information, see Setting up HealthKit.
Topics
Accessing HealthKit
authorizationStatus(for:)HKAuthorizationStatusgetRequestStatusForAuthorization(toShare:read:completion:)HKAuthorizationRequestStatusisHealthDataAvailable()supportsHealthRecords()requestAuthorization(toShare:read:completion:)requestAuthorization(toShare:read:)requestPerObjectReadAuthorization(for:predicate:completion:)handleAuthorizationForExtension(completion:)authorizationViewControllerPresentergetEarliestAuthorizedSampleDate(for:completion:)earliestPermittedSampleDate()
Querying HealthKit data
Reading characteristic data
Working with HealthKit objects
delete(_:withCompletion:)delete(_:withCompletion:)deleteObjects(of:predicate:withCompletion:)save(_:withCompletion:)save(_:withCompletion:)
Accessing the preferred units
Managing background delivery
enableBackgroundDelivery(for:frequency:withCompletion:)com.apple.developer.healthkit.background-deliveryHKUpdateFrequencydisableBackgroundDelivery(for:withCompletion:)disableAllBackgroundDelivery(completion:)