Reputation: 3
I'm trying to get heart rate readings through the healthkit store using HKSampleQuery, but I keep getting count/s. Is there anyway I can get it by count/minute?
Upvotes: 0
Views: 972
Reputation: 1574
Try using something like the following in the completion handler of a HKSampleQuery
let result = results?.last as HKQuantitySample
let quantity = result.quantity
let count = quantity.doubleValueForUnit(HKUnit(fromString: "count/min"))
Upvotes: 2