iiat
iiat

Reputation: 3

HealthKit HKSampleQuery Heart rate readings

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

Answers (1)

The-First-Tiger
The-First-Tiger

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

Related Questions