Thank you Matt for this really helpful tutorial.
To use real data instead of mockdata, do I remove this line:
let heartRateQuantity = HKQuantity(unit: HKUnit(fromString: âcount/minâ),
doubleValue: Double(arc4random_uniform(80) + 100))
Or do I just remove âdoubleValue: Double(arc4random_uniform(80) + 100))â
Iâm having trouble understanding which part of the code is the mock rate and which part is real?
Also If I want to stop the measure on a âstopâ button tapped (eg âstopped walkingâ, like you had a button for started walking), instead of the set duration timer, how can I do that?
eg You noted that ORKActiveStep is the set duration lines âclass MusicStep: ORKActiveStep {
var clip: MusicClip!
}â
Do I remove that code as well as all of the code in âMusic Stepâ? And then just as you have the UI Button for âwalktappedâ which leads to HealthKitManager.startMockHeartData(), I can add another UI button for HealthKitManager.startMockHeartData()
Hi, I am also wondering how to use the real data, have you found a solution?
This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]