Xcode Swift Coremotion Pedometer update every step

Hello! Does anyone know if there is a way for the CoreMotion Pedometer to update every step? As it is, it always seems to take a certain amount of time/steps to update, even when force started.

I've also been trying to find workarounds (with other pedometers, it is sometimes possible to grab the "signal" and count that), but none have worked.

Is this outside of CoreMotion's scope? Does anyone have any other suggestions or workarounds?

Thank you!

Replies

AFAIK, answer is no.

A few reference material:

https://stackoverflow.com/questions/36439912/live-updates-with-cmpedometer-coremotion

h t t p s : / / medium.com/simform-engineering/count-steps-with-cmpedometer-on-iwatch-94b61bc3b87e

The pedometer is a higher level object on Core motion. It sets its own refresh rates and we can get updates through a closure, so it’s on its own schedule, not one we can control.

Just an idea, for what it's worth. Using the actual speed and the recent ratio steps/speed, maybe you could estimate the count at the frequency you want, and display it. Then, as soon as you receive a new pedometer information, update everything. I don't know if that would be good enough or too chaotic information display.

  • Thank you so much for your response! I think I'll trying work with the update rates that Core Motion has.

Add a Comment