I am trying to display the steps of a user to a metrics view screen in an apple watch.
Here is how I try to get the steps:
KQuantityType.quantityType(forIdentifier: .stepCount):
let stepCount = HKUnit.meter()
self.stepCount = statistics.sumQuantity()?.doubleValue(for: stepCount) ?? 0
print("step count: \(self.stepCount ?? 0)")
Where stepCount is a published variable.
I then try to display the steps:
Text("\(workoutManager.stepCount!) steps")
I am not able to see the steps in a log when I try to print or through Text....any ideas on how to do this?