predicate = HKQuery.predicateForSamples(withStart: start, end: end) let query = HKSampleQuery(sampleType: type, predicate: predicate, limit: HKObjectQueryNoLimit, sortDescriptors: nil) { (query, result, error) in let result = result as! [HKQuantitySample] let sum = result(0) { $0 + $1.quantity.doubleValue(for: .count()) } print(sum) } store.execute(query) )FBMUI,JUΛར༻͢Δ HKSampleQuery ɹ݅ʹϚον͢Δ ɹݸʑͷΛऔಘ͢Δ ɹݸʑͷͰͳ͘ɺ ɹσʔλͷಛ͕Γ͍ͨ