watchos-4

HKSampleQuery will only return values from past 7 days?

谁说胖子不能爱 提交于 2019-12-25 01:54:07
问题 This is a WatchOS App. Through testing, it appears as though this code will only return any bodyweight values that I manually add to the health app that are less than 1 week old. Is this intended? Ways around? func getUserBodyMass(completion: @escaping (HKQuantitySample) -> Void) { guard let weightSampleType = HKSampleType.quantityType(forIdentifier: .bodyMass) else { print("Body Mass Sample Type is no longer available in HealthKit") return } //1. Use HKQuery to load the most recent samples.