Get the average daily number of steps in Swift 3.0

Asked 2 years ago, Updated 2 years ago, 41 views

I would like to get daily steps with Swift 3.0.
However, I don't know how to retrieve data daily or one month ago.
How do I get the average daily number of steps for HealthKit and data from a month ago?
Also, I would like to put the data I got every minute of the day in the array and graph it.
The image is like the iPhone app's healthcare step number display.
How do I retrieve data from the array every minute of the day?
Please reply.

swift

2022-09-30 21:18

1 Answers

Store data in the database every minute and
I think you can get that data when you display it.
I don't think I can do it unless I store the data somewhere.

However, if you accumulate data every minute, it consumes a reasonable amount of space, so
After a certain period of time, we recommend that you aggregate data per minute into a day.


2022-09-30 21:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.