HealthKit iOS 15.5 to 16.0 API Differences

HKActivitySummary.h
Added HKActivitySummary.exerciseTimeGoal
Added HKActivitySummary.standHoursGoal
Modified HKActivitySummary.appleExerciseTimeGoal
Availability
FromAvailable
ToDeprecated

Modified HKActivitySummary.appleStandHoursGoal
Availability
FromAvailable
ToDeprecated

HKAttachment.h
Added HKAttachment
Added HKAttachment.identifier
Added HKAttachment.name
Added HKAttachment.contentType
Added HKAttachment.size
Added HKAttachment.creationDate
Added HKAttachment.metadata
HKAttachmentStore.h
Added HKAttachmentStore
Added -[HKAttachmentStore initWithHealthStore:]
Added -[HKAttachmentStore addAttachmentToObject:name:contentType:URL:metadata:completion:]
Added -[HKAttachmentStore removeAttachment:fromObject:completion:]
Added -[HKAttachmentStore getAttachmentsForObject:completion:]
Added -[HKAttachmentStore getDataForAttachment:completion:]
Added -[HKAttachmentStore streamDataForAttachment:dataHandler:]
HKCDADocumentSample.h
Modified HKCDADocument.documentData
Declaration
From@property (readonly, copy, nullable) NSData *documentData
To@property (readonly, copy, nullable) NSData *documentData

Modified HKCDADocument.title
Declaration
From@property (readonly, copy, nonnull) NSString *title
To@property (readonly, copy, nonnull) NSString *title

Modified HKCDADocument.patientName
Declaration
From@property (readonly, copy, nonnull) NSString *patientName
To@property (readonly, copy, nonnull) NSString *patientName

Modified HKCDADocument.authorName
Declaration
From@property (readonly, copy, nonnull) NSString *authorName
To@property (readonly, copy, nonnull) NSString *authorName

Modified HKCDADocument.custodianName
Declaration
From@property (readonly, copy, nonnull) NSString *custodianName
To@property (readonly, copy, nonnull) NSString *custodianName

HKClinicalRecord.h
Modified HKPredicateKeyPathClinicalRecordFHIRResourceIdentifier
Declaration
FromAPI_AVAILABLE(ios(12.0)) NSString *const HKPredicateKeyPathClinicalRecordFHIRResourceIdentifier
To__WATCHOS_PROHIBITED NSString *const HKPredicateKeyPathClinicalRecordFHIRResourceIdentifier

Modified HKPredicateKeyPathClinicalRecordFHIRResourceType
Declaration
FromAPI_AVAILABLE(ios(12.0)) NSString *const HKPredicateKeyPathClinicalRecordFHIRResourceType
To__WATCHOS_PROHIBITED NSString *const HKPredicateKeyPathClinicalRecordFHIRResourceType

HKContactsLensSpecification.h
Added HKContactsLensSpecification
Added HKContactsLensSpecification.baseCurve
Added HKContactsLensSpecification.diameter
Added -[HKContactsLensSpecification initWithSphere:cylinder:axis:addPower:baseCurve:diameter:]
HKContactsPrescription.h
Added HKContactsPrescription
Added HKContactsPrescription.rightEye
Added HKContactsPrescription.leftEye
Added HKContactsPrescription.brand
Added +[HKContactsPrescription prescriptionWithRightEyeSpecification:leftEyeSpecification:brand:dateIssued:expirationDate:device:metadata:]
HKDefines.h
Added HKCategoryValueSleepAnalysisAsleepUnspecified
Added HKCategoryValueSleepAnalysisAsleepCore
Added HKCategoryValueSleepAnalysisAsleepDeep
Added HKCategoryValueSleepAnalysisAsleepREM
Added HKCategoryValueSleepAnalysisAsleepValues()
Modified HKCategoryValueSleepAnalysisAsleep
Availability
FromAvailable
ToDeprecated

HKElectrocardiogramQuery.h
Modified HKElectrocardiogramVoltageMeasurement
Protocols
Fromnone
ToNSCopying

HKFHIRRelease.h
Modified HKFHIRReleaseUnknown
Declaration
FromAPI_AVAILABLE(ios(14.0)) const HKFHIRRelease HKFHIRReleaseUnknown
ToAPI_UNAVAILABLE(watchos) const HKFHIRRelease HKFHIRReleaseUnknown

HKFHIRResource.h
Modified HKFHIRResourceTypeAllergyIntolerance
Declaration
FromAPI_AVAILABLE(ios(12.0)) const HKFHIRResourceType HKFHIRResourceTypeAllergyIntolerance
ToAPI_UNAVAILABLE(watchos) const HKFHIRResourceType HKFHIRResourceTypeAllergyIntolerance

Modified HKFHIRResourceTypeCondition
Declaration
FromAPI_AVAILABLE(ios(12.0)) const HKFHIRResourceType HKFHIRResourceTypeCondition
ToAPI_UNAVAILABLE(watchos) const HKFHIRResourceType HKFHIRResourceTypeCondition

Modified HKFHIRResourceTypeCoverage
Declaration
FromAPI_AVAILABLE(ios(14.0)) const HKFHIRResourceType HKFHIRResourceTypeCoverage
ToAPI_UNAVAILABLE(watchos) const HKFHIRResourceType HKFHIRResourceTypeCoverage

Modified HKFHIRResourceTypeImmunization
Declaration
FromAPI_AVAILABLE(ios(12.0)) const HKFHIRResourceType HKFHIRResourceTypeImmunization
ToAPI_UNAVAILABLE(watchos) const HKFHIRResourceType HKFHIRResourceTypeImmunization

Modified HKFHIRResourceTypeMedicationDispense
Declaration
FromAPI_AVAILABLE(ios(12.0)) const HKFHIRResourceType HKFHIRResourceTypeMedicationDispense
ToAPI_UNAVAILABLE(watchos) const HKFHIRResourceType HKFHIRResourceTypeMedicationDispense

Modified HKFHIRResourceTypeMedicationOrder
Declaration
FromAPI_AVAILABLE(ios(12.0)) const HKFHIRResourceType HKFHIRResourceTypeMedicationOrder
ToAPI_UNAVAILABLE(watchos) const HKFHIRResourceType HKFHIRResourceTypeMedicationOrder

Modified HKFHIRResourceTypeMedicationRequest
Declaration
FromAPI_AVAILABLE(ios(14.0)) const HKFHIRResourceType HKFHIRResourceTypeMedicationRequest
ToAPI_UNAVAILABLE(watchos) const HKFHIRResourceType HKFHIRResourceTypeMedicationRequest

Modified HKFHIRResourceTypeMedicationStatement
Declaration
FromAPI_AVAILABLE(ios(12.0)) const HKFHIRResourceType HKFHIRResourceTypeMedicationStatement
ToAPI_UNAVAILABLE(watchos) const HKFHIRResourceType HKFHIRResourceTypeMedicationStatement

Modified HKFHIRResourceTypeObservation
Declaration
FromAPI_AVAILABLE(ios(12.0)) const HKFHIRResourceType HKFHIRResourceTypeObservation
ToAPI_UNAVAILABLE(watchos) const HKFHIRResourceType HKFHIRResourceTypeObservation

Modified HKFHIRResourceTypeProcedure
Declaration
FromAPI_AVAILABLE(ios(12.0)) const HKFHIRResourceType HKFHIRResourceTypeProcedure
ToAPI_UNAVAILABLE(watchos) const HKFHIRResourceType HKFHIRResourceTypeProcedure

Modified HKFHIRResource.FHIRVersion
Declaration
From@property (readonly, copy, nonnull) HKFHIRVersion *FHIRVersion
To@property (readonly, copy, nonnull) HKFHIRVersion *FHIRVersion

HKGlassesLensSpecification.h
Added HKGlassesLensSpecification
Added HKGlassesLensSpecification.vertexDistance
Added HKGlassesLensSpecification.prism
Added HKGlassesLensSpecification.farPupillaryDistance
Added HKGlassesLensSpecification.nearPupillaryDistance
Added -[HKGlassesLensSpecification initWithSphere:cylinder:axis:addPower:vertexDistance:prism:farPupillaryDistance:nearPupillaryDistance:]
HKGlassesPrescription.h
Added HKGlassesPrescription
Added HKGlassesPrescription.glassesDescription
Added HKGlassesPrescription.rightEye
Added HKGlassesPrescription.leftEye
Added +[HKGlassesPrescription prescriptionWithRightEyeSpecification:leftEyeSpecification:description:dateIssued:expirationDate:device:metadata:]
HKHealthStore.h
Added -[HKHealthStore requestPerObjectReadAuthorizationForType:predicate:completion:]
HKLensSpecification.h
Added HKLensSpecification
Added HKLensSpecification.sphere
Added HKLensSpecification.cylinder
Added HKLensSpecification.axis
Added HKLensSpecification.addPower
HKMetadata.h
Added HKMetadataKeyUserMotionContext
Added HKUserMotionContext
Added HKUserMotionContextNotSet
Added HKUserMotionContextStationary
Added HKUserMotionContextActive
Added HKMetadataKeySessionEstimate
Added HKHeartRateRecoveryTestType
Added HKHeartRateRecoveryTestTypeMaxExercise
Added HKHeartRateRecoveryTestTypePredictionSubMaxExercise
Added HKHeartRateRecoveryTestTypePredictionNonExercise
Added HKMetadataKeyHeartRateRecoveryTestType
Added HKMetadataKeyHeartRateRecoveryActivityType
Added HKMetadataKeyHeartRateRecoveryActivityDuration
Added HKMetadataKeyHeartRateRecoveryMaxObservedRecoveryHeartRate
Added HKSwimmingStrokeStyleKickboard
Added HKMetadataKeySWOLFScore
Added HKMetadataKeyQuantityClampedToLowerBound
Added HKMetadataKeyQuantityClampedToUpperBound
HKObjectType.h
Added +[HKObjectType visionPrescriptionType]
Added -[HKObjectType requiresPerObjectAuthorization]
Added HKPrescriptionType
HKQuery.h
Added +[HKQuery predicateForCategorySamplesEqualToValues:]
Added +[HKQuery predicateForWorkoutsWithOperatorType:quantityType:sumQuantity:]
Added +[HKQuery predicateForWorkoutsWithOperatorType:quantityType:minimumQuantity:]
Added +[HKQuery predicateForWorkoutsWithOperatorType:quantityType:maximumQuantity:]
Added +[HKQuery predicateForWorkoutsWithOperatorType:quantityType:averageQuantity:]
Added +[HKQuery predicateForWorkoutActivitiesWithWorkoutActivityType:]
Added +[HKQuery predicateForWorkoutActivitiesWithOperatorType:duration:]
Added +[HKQuery predicateForWorkoutActivitiesWithStartDate:endDate:options:]
Added +[HKQuery predicateForWorkoutActivitiesWithOperatorType:quantityType:sumQuantity:]
Added +[HKQuery predicateForWorkoutActivitiesWithOperatorType:quantityType:minimumQuantity:]
Added +[HKQuery predicateForWorkoutActivitiesWithOperatorType:quantityType:maximumQuantity:]
Added +[HKQuery predicateForWorkoutActivitiesWithOperatorType:quantityType:averageQuantity:]
Added +[HKQuery predicateForWorkoutsWithActivityPredicate:]
Modified +[HKQuery predicateForWorkoutsWithOperatorType:totalEnergyBurned:]
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse predicateForWorkoutActivitiesWithOperatorType:quantityType:sumQuantity: passing the HKQuantityType for HKQuantityTypeIdentifierActiveEnergyBurned

Modified +[HKQuery predicateForWorkoutsWithOperatorType:totalDistance:]
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse predicateForWorkoutActivitiesWithOperatorType:quantityType:sumQuantity: passing the HKQuantityType for the desired distance type

Modified +[HKQuery predicateForWorkoutsWithOperatorType:totalSwimmingStrokeCount:]
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse predicateForWorkoutActivitiesWithOperatorType:quantityType:sumQuantity:

Modified +[HKQuery predicateForWorkoutsWithOperatorType:totalFlightsClimbed:]
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse predicateForWorkoutActivitiesWithOperatorType:quantityType:sumQuantity: passing the HKQuantityType for HKQuantityTypeIdentifierSwimmingStrokeCount

HKTypeIdentifiers.h
Added HKQuantityTypeIdentifierRunningStrideLength
Added HKQuantityTypeIdentifierRunningVerticalOscillation
Added HKQuantityTypeIdentifierRunningGroundContactTime
Added HKQuantityTypeIdentifierRunningPower
Added HKQuantityTypeIdentifierRunningSpeed
Added HKQuantityTypeIdentifierHeartRateRecoveryOneMinute
Added HKVisionPrescriptionTypeIdentifier
HKUnit.h
Added +[HKUnit wattUnitWithMetricPrefix:]
Added +[HKUnit wattUnit]
Added +[HKUnit diopterUnit]
Added +[HKUnit prismDiopterUnit]
Added +[HKUnit radianAngleUnitWithMetricPrefix:]
Added +[HKUnit radianAngleUnit]
Added +[HKUnit degreeAngleUnit]
HKVisionPrescription.h
Added HKVisionPrescriptionType
Added HKVisionPrescriptionTypeGlasses
Added HKVisionPrescriptionTypeContacts
Added HKVisionPrescription
Added HKVisionPrescription.prescriptionType
Added HKVisionPrescription.dateIssued
Added HKVisionPrescription.expirationDate
Added +[HKVisionPrescription prescriptionWithType:dateIssued:expirationDate:device:metadata:]
HKVisionPrism.h
Added HKPrismBase
Added HKPrismBaseNone
Added HKPrismBaseUp
Added HKPrismBaseDown
Added HKPrismBaseIn
Added HKPrismBaseOut
Added HKVisionEye
Added HKVisionEyeLeft
Added HKVisionEyeRight
Added HKVisionPrism
Added HKVisionPrism.amount
Added HKVisionPrism.angle
Added HKVisionPrism.verticalAmount
Added HKVisionPrism.horizontalAmount
Added HKVisionPrism.verticalBase
Added HKVisionPrism.horizontalBase
Added HKVisionPrism.eye
Added -[HKVisionPrism initWithAmount:angle:eye:]
Added -[HKVisionPrism initWithVerticalAmount:verticalBase:horizontalAmount:horizontalBase:eye:]
HKWorkout.h
Added HKWorkoutActivityTypeSwimBikeRun
Added HKWorkoutActivityTypeTransition
Added HKWorkout.workoutActivities
Added HKWorkout.allStatistics
Added -[HKWorkout statisticsForType:]
Added HKPredicateKeyPathWorkoutSumQuantity
Added HKPredicateKeyPathWorkoutMinimumQuantity
Added HKPredicateKeyPathWorkoutMaximumQuantity
Added HKPredicateKeyPathWorkoutAverageQuantity
Added HKPredicateKeyPathWorkoutActivity
Modified HKWorkout.totalEnergyBurned
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse statisticsForType: passing the HKQuantityType for HKQuantityTypeIdentifierActiveEnergyBurned

Modified HKWorkout.totalDistance
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse statisticsForType: passing the HKQuantityType for the desired distance type

Modified HKWorkout.totalSwimmingStrokeCount
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse statisticsForType: passing the HKQuantityType for HKQuantityTypeIdentifierSwimmingStrokeCount

Modified HKWorkout.totalFlightsClimbed
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse statisticsForType: passing the HKQuantityType for HKQuantityTypeIdentifierFlightClimbed

HKWorkoutActivity.h
Added HKWorkoutActivity
Added HKWorkoutActivity.UUID
Added HKWorkoutActivity.workoutConfiguration
Added HKWorkoutActivity.startDate
Added HKWorkoutActivity.endDate
Added HKWorkoutActivity.metadata
Added HKWorkoutActivity.duration
Added HKWorkoutActivity.workoutEvents
Added HKWorkoutActivity.allStatistics
Added -[HKWorkoutActivity statisticsForType:]
Added -[HKWorkoutActivity initWithWorkoutConfiguration:startDate:endDate:metadata:]
Added HKPredicateKeyPathWorkoutActivityType
Added HKPredicateKeyPathWorkoutActivityDuration
Added HKPredicateKeyPathWorkoutActivityStartDate
Added HKPredicateKeyPathWorkoutActivityEndDate
Added HKPredicateKeyPathWorkoutActivitySumQuantity
Added HKPredicateKeyPathWorkoutActivityMinimumQuantity
Added HKPredicateKeyPathWorkoutActivityMaximumQuantity
Added HKPredicateKeyPathWorkoutActivityAverageQuantity
HKWorkoutBuilder.h
Added HKWorkoutBuilder.workoutActivities
Added HKWorkoutBuilder.allStatistics
Added -[HKWorkoutBuilder addWorkoutActivity:completion:]
Added -[HKWorkoutBuilder updateActivityWithUUID:endDate:completion:]
Added -[HKWorkoutBuilder updateActivityWithUUID:addMedatata:completion:]
HKWorkoutRouteQuery.h
Added -[HKWorkoutRouteQuery initWithRoute:dateInterval:dataHandler:]