Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Continuous Timeline in Iphone App?

Background: Workout App is designed to have a continuous timeline that I can then input what exercise and reps I'm doing in real-time, then graph the results in real-time.

Issue: When the iphone sleeps for too long, we lose the continuity of the Timeline and it restarts. We haven't figured out how to keep the timeline updating while the App is sleeping. I've asked him to do a call to the Iphone internal clock and do the math on where the viewer should be and move them to that point on the timeline. However, he can't figure out how to do this.

Solutions: Have you folks heard of anyways to do this call to the internal clock? Perhaps a better question, can you think of another way around the problem in general?

like image 693
scottorn Avatar asked Sep 10 '26 22:09

scottorn


1 Answers

You could try CACurrentMediaTime which returns mach_absolute_time in seconds. This should be accurate across sleep.

like image 161
drawnonward Avatar answered Sep 12 '26 13:09

drawnonward



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!