hksamplequery

Get total step count for every date in HealthKit

拥有回忆 提交于 2019-11-26 14:05:39
问题 What's the best way to get a total step count for every day recorded in HealthKit . With HKSampleQuery's method initWithSampleType (see below) I can set a start and end date for the query using NSPredicate , but the method returns an array with many HKQuantitySamples per day. - (instancetype)initWithSampleType:(HKSampleType *)sampleType predicate:(NSPredicate *)predicate limit:(NSUInteger)limit sortDescriptors:(NSArray *)sortDescriptors resultsHandler:(void (^)(HKSampleQuery *query, NSArray