HealthKit Changes for Objective-C
HealthKit
HKAnchoredObjectQuery.h
Added HKQueryAnchor
Declaration | Deprecation | |
---|---|---|
From | - (instancetype)initWithType:(HKSampleType *)type predicate:(NSPredicate *)predicate anchor:(NSUInteger)anchor limit:(NSUInteger)limit completionHandler:(void (^)(HKAnchoredObjectQuery *query, NSArray *results, NSUInteger newAnchor, NSError *error))handler | -- |
To | - (instancetype _Nonnull)initWithType:(HKSampleType * _Nonnull)type predicate:(NSPredicate * _Nullable)predicate anchor:(NSUInteger)anchor limit:(NSUInteger)limit completionHandler:(void (^ _Nonnull)(HKAnchoredObjectQuery * _Nonnull query, NSArray<__kindof HKSample *> * _Nullable results, NSUInteger newAnchor, NSError * _Nullable error))handler | iOS 9.0 |
HKCategorySample.h
Declaration | |
---|---|
From | + (instancetype)categorySampleWithType:(HKCategoryType *)type value:(NSInteger)value startDate:(NSDate *)startDate endDate:(NSDate *)endDate metadata:(NSDictionary *)metadata |
To | + (instancetype _Nonnull)categorySampleWithType:(HKCategoryType * _Nonnull)type value:(NSInteger)value startDate:(NSDate * _Nonnull)startDate endDate:(NSDate * _Nonnull)endDate metadata:(NSDictionary<NSString *,id> * _Nullable)metadata |
HKCorrelation.h
Modified HKCorrelation
Protocols | |
---|---|
From | NSSecureCoding |
To | -- |
Declaration | |
---|---|
From | + (instancetype)correlationWithType:(HKCorrelationType *)correlationType startDate:(NSDate *)startDate endDate:(NSDate *)endDate objects:(NSSet *)objects |
To | + (instancetype _Nonnull)correlationWithType:(HKCorrelationType * _Nonnull)correlationType startDate:(NSDate * _Nonnull)startDate endDate:(NSDate * _Nonnull)endDate objects:(NSSet<HKSample *> * _Nonnull)objects |
Declaration | |
---|---|
From | + (instancetype)correlationWithType:(HKCorrelationType *)correlationType startDate:(NSDate *)startDate endDate:(NSDate *)endDate objects:(NSSet *)objects metadata:(NSDictionary *)metadata |
To | + (instancetype _Nonnull)correlationWithType:(HKCorrelationType * _Nonnull)correlationType startDate:(NSDate * _Nonnull)startDate endDate:(NSDate * _Nonnull)endDate objects:(NSSet<HKSample *> * _Nonnull)objects metadata:(NSDictionary<NSString *,id> * _Nullable)metadata |
Modified HKCorrelation.objects
Declaration | |
---|---|
From | @property(readonly, copy) NSSet *objects |
To | @property(readonly, copy, nonnull) NSSet<__kindof HKSample *> *objects |
Modified -[HKCorrelation objectsForType:]
Declaration | |
---|---|
From | - (NSSet *)objectsForType:(HKObjectType *)objectType |
To | - (NSSet<__kindof HKSample *> * _Nonnull)objectsForType:(HKObjectType * _Nonnull)objectType |
HKCorrelationQuery.h
Declaration | |
---|---|
From | - (instancetype)initWithType:(HKCorrelationType *)correlationType predicate:(NSPredicate *)predicate samplePredicates:(NSDictionary *)samplePredicates completion:(void (^)(HKCorrelationQuery *query, NSArray *correlations, NSError *error))completion |
To | - (instancetype _Nonnull)initWithType:(HKCorrelationType * _Nonnull)correlationType predicate:(NSPredicate * _Nullable)predicate samplePredicates:(NSDictionary<HKSampleType *,NSPredicate *> * _Nullable)samplePredicates completion:(void (^ _Nonnull)(HKCorrelationQuery * _Nonnull query, NSArray<HKCorrelation *> * _Nullable correlations, NSError * _Nullable error))completion |
Modified HKCorrelationQuery.samplePredicates
Declaration | |
---|---|
From | @property(readonly, copy) NSDictionary *samplePredicates |
To | @property(readonly, copy, nullable) NSDictionary<__kindof HKSampleType *,NSPredicate *> *samplePredicates |
HKDefines.h
Added #def HK_AVAILABLE_WATCHOS_ONLY
Added #def HK_CLASS_AVAILABLE_WATCHOS_ONLY
Added HKCategoryValue
Added HKFitzpatrickSkinType
Added HKFitzpatrickSkinTypeI
Added HKFitzpatrickSkinTypeII
Added HKFitzpatrickSkinTypeIII
Added HKFitzpatrickSkinTypeIV
Added HKFitzpatrickSkinTypeV
Added HKFitzpatrickSkinTypeVI
HKDeletedObject.h (Added)
Added HKDeletedObject
Added HKDeletedObject.UUID
HKDevice.h (Added)
Added HKDevice
Added HKDevice.firmwareVersion
Added HKDevice.hardwareVersion
Added +[HKDevice localDevice]
Added HKDevice.localIdentifier
Added HKDevice.manufacturer
Added HKDevice.model
Added HKDevice.name
Added HKDevice.softwareVersion
Added HKDevicePropertyKeyModel
Added HKDevicePropertyKeyName
HKHealthStore.h
Modified HKBiologicalSexObject
Protocols | |
---|---|
From | -- |
To | NSCopying, NSSecureCoding |
Modified HKBloodTypeObject
Protocols | |
---|---|
From | -- |
To | NSCopying, NSSecureCoding |
Modified HKHealthStore
App Extension[Available] | App Extension[Message] | |
---|---|---|
From | no | HealthKit is not supported in extensions |
To | -- | -- |
Declaration | |
---|---|
From | - (void)addSamples:(NSArray *)samples toWorkout:(HKWorkout *)workout completion:(void (^)(BOOL success, NSError *error))completion |
To | - (void)addSamples:(NSArray<HKSample *> * _Nonnull)samples toWorkout:(HKWorkout * _Nonnull)workout completion:(void (^ _Nonnull)(BOOL success, NSError * _Nullable error))completion |
App Extension[Available] | App Extension[Message] | |
---|---|---|
From | no | HealthKit is not supported in extensions |
To | -- | -- |
App Extension[Available] | App Extension[Message] | |
---|---|---|
From | no | HealthKit is not supported in extensions |
To | -- | -- |
Modified -[HKHealthStore bloodTypeWithError:]
App Extension[Available] | App Extension[Message] | |
---|---|---|
From | no | HealthKit is not supported in extensions |
To | -- | -- |
App Extension[Available] | App Extension[Message] | |
---|---|---|
From | no | HealthKit is not supported in extensions |
To | -- | -- |
App Extension[Available] | App Extension[Message] | |
---|---|---|
From | no | HealthKit is not supported in extensions |
To | -- | -- |
Modified -[HKHealthStore executeQuery:]
App Extension[Available] | App Extension[Message] | |
---|---|---|
From | no | HealthKit is not supported in extensions |
To | -- | -- |
App Extension[Available] | App Extension[Message] | |
---|---|---|
From | no | HealthKit is not supported in extensions |
To | -- | -- |
Declaration | |
---|---|
From | - (void)preferredUnitsForQuantityTypes:(NSSet *)quantityTypes completion:(void (^)(NSDictionary *preferredUnits, NSError *error))completion |
To | - (void)preferredUnitsForQuantityTypes:(NSSet<HKQuantityType *> * _Nonnull)quantityTypes completion:(void (^ _Nonnull)(NSDictionary<HKQuantityType *,HKUnit *> * _Nonnull preferredUnits, NSError * _Nullable error))completion |
Declaration | App Extension[Available] | App Extension[Message] | |
---|---|---|---|
From | - (void)requestAuthorizationToShareTypes:(NSSet *)typesToShare readTypes:(NSSet *)typesToRead completion:(void (^)(BOOL success, NSError *error))completion | no | HealthKit is not supported in extensions |
To | - (void)requestAuthorizationToShareTypes:(NSSet<HKSampleType *> * _Nullable)typesToShare readTypes:(NSSet<HKObjectType *> * _Nullable)typesToRead completion:(void (^ _Nonnull)(BOOL success, NSError * _Nullable error))completion | -- | -- |
App Extension[Available] | App Extension[Message] | |
---|---|---|
From | no | HealthKit is not supported in extensions |
To | -- | -- |
Declaration | App Extension[Available] | App Extension[Message] | |
---|---|---|---|
From | - (void)saveObjects:(NSArray *)objects withCompletion:(void (^)(BOOL success, NSError *error))completion | no | HealthKit is not supported in extensions |
To | - (void)saveObjects:(NSArray<HKObject *> * _Nonnull)objects withCompletion:(void (^ _Nonnull)(BOOL success, NSError * _Nullable error))completion | -- | -- |
Modified -[HKHealthStore stopQuery:]
App Extension[Available] | App Extension[Message] | |
---|---|---|
From | no | HealthKit is not supported in extensions |
To | -- | -- |
HKMetadata.h
HKObject.h
Modified HKObject.metadata
Declaration | |
---|---|
From | @property(readonly, copy) NSDictionary *metadata |
To | @property(readonly, copy, nullable) NSDictionary<NSString *,id> *metadata |
Modified HKObject.source
Deprecation | |
---|---|
From | -- |
To | iOS 9.0 |
HKQuantitySample.h
Declaration | |
---|---|
From | + (instancetype)quantitySampleWithType:(HKQuantityType *)quantityType quantity:(HKQuantity *)quantity startDate:(NSDate *)startDate endDate:(NSDate *)endDate metadata:(NSDictionary *)metadata |
To | + (instancetype _Nonnull)quantitySampleWithType:(HKQuantityType * _Nonnull)quantityType quantity:(HKQuantity * _Nonnull)quantity startDate:(NSDate * _Nonnull)startDate endDate:(NSDate * _Nonnull)endDate metadata:(NSDictionary<NSString *,id> * _Nullable)metadata |
HKQuery.h
Declaration | |
---|---|
From | + (NSPredicate *)predicateForObjectsFromSources:(NSSet *)sources |
To | + (NSPredicate * _Nonnull)predicateForObjectsFromSources:(NSSet<HKSource *> * _Nonnull)sources |
Declaration | |
---|---|
From | + (NSPredicate *)predicateForObjectsWithUUIDs:(NSSet *)UUIDs |
To | + (NSPredicate * _Nonnull)predicateForObjectsWithUUIDs:(NSSet<NSUUID *> * _Nonnull)UUIDs |
HKSampleQuery.h
Declaration | |
---|---|
From | - (instancetype)initWithSampleType:(HKSampleType *)sampleType predicate:(NSPredicate *)predicate limit:(NSUInteger)limit sortDescriptors:(NSArray *)sortDescriptors resultsHandler:(void (^)(HKSampleQuery *query, NSArray *results, NSError *error))resultsHandler |
To | - (instancetype _Nonnull)initWithSampleType:(HKSampleType * _Nonnull)sampleType predicate:(NSPredicate * _Nullable)predicate limit:(NSUInteger)limit sortDescriptors:(NSArray<NSSortDescriptor *> * _Nullable)sortDescriptors resultsHandler:(void (^ _Nonnull)(HKSampleQuery * _Nonnull query, NSArray<__kindof HKSample *> * _Nullable results, NSError * _Nullable error))resultsHandler |
Modified HKSampleQuery.sortDescriptors
Declaration | |
---|---|
From | @property(readonly, copy) NSArray *sortDescriptors |
To | @property(readonly, copy, nullable) NSArray<NSSortDescriptor *> *sortDescriptors |
HKSourceQuery.h
Declaration | |
---|---|
From | - (instancetype)initWithSampleType:(HKSampleType *)sampleType samplePredicate:(NSPredicate *)objectPredicate completionHandler:(void (^)(HKSourceQuery *query, NSSet *sources, NSError *error))completionHandler |
To | - (instancetype _Nonnull)initWithSampleType:(HKSampleType * _Nonnull)sampleType samplePredicate:(NSPredicate * _Nullable)objectPredicate completionHandler:(void (^ _Nonnull)(HKSourceQuery * _Nonnull query, NSSet<HKSource *> * _Nullable sources, NSError * _Nullable error))completionHandler |
HKSourceRevision.h (Added)
HKStatistics.h
Modified HKStatistics.sources
Declaration | |
---|---|
From | @property(readonly, strong) NSArray *sources |
To | @property(readonly, strong, nullable) NSArray<HKSource *> *sources |
HKStatisticsCollectionQuery.h
Modified -[HKStatisticsCollection sources]
Declaration | |
---|---|
From | - (NSSet *)sources |
To | - (NSSet<HKSource *> * _Nonnull)sources |
Modified -[HKStatisticsCollection statistics]
Declaration | |
---|---|
From | - (NSArray *)statistics |
To | - (NSArray<HKStatistics *> * _Nonnull)statistics |
HKTypeIdentifiers.h
HKUnit.h
HKWorkout.h
Modified HKWorkout.workoutEvents
Declaration | |
---|---|
From | @property(readonly, copy) NSArray *workoutEvents |
To | @property(readonly, copy, nullable) NSArray<HKWorkoutEvent *> *workoutEvents |
Declaration | |
---|---|
From | + (instancetype)workoutWithActivityType:(HKWorkoutActivityType)workoutActivityType startDate:(NSDate *)startDate endDate:(NSDate *)endDate duration:(NSTimeInterval)duration totalEnergyBurned:(HKQuantity *)totalEnergyBurned totalDistance:(HKQuantity *)totalDistance metadata:(NSDictionary *)metadata |
To | + (instancetype _Nonnull)workoutWithActivityType:(HKWorkoutActivityType)workoutActivityType startDate:(NSDate * _Nonnull)startDate endDate:(NSDate * _Nonnull)endDate duration:(NSTimeInterval)duration totalEnergyBurned:(HKQuantity * _Nullable)totalEnergyBurned totalDistance:(HKQuantity * _Nullable)totalDistance metadata:(NSDictionary<NSString *,id> * _Nullable)metadata |
Declaration | |
---|---|
From | + (instancetype)workoutWithActivityType:(HKWorkoutActivityType)workoutActivityType startDate:(NSDate *)startDate endDate:(NSDate *)endDate workoutEvents:(NSArray *)workoutEvents totalEnergyBurned:(HKQuantity *)totalEnergyBurned totalDistance:(HKQuantity *)totalDistance metadata:(NSDictionary *)metadata |
To | + (instancetype _Nonnull)workoutWithActivityType:(HKWorkoutActivityType)workoutActivityType startDate:(NSDate * _Nonnull)startDate endDate:(NSDate * _Nonnull)endDate workoutEvents:(NSArray<HKWorkoutEvent *> * _Nullable)workoutEvents totalEnergyBurned:(HKQuantity * _Nullable)totalEnergyBurned totalDistance:(HKQuantity * _Nullable)totalDistance metadata:(NSDictionary<NSString *,id> * _Nullable)metadata |
HKWorkoutSession.h (Added)
Added HKWorkoutSessionState