阅读背景:

iOS CoreMotion API - 有没有办法跟踪某人在一段时间内走路的次数?

来源:互联网 

I'm trying to write a simple app that will allow me to keep track of my average walking time over a set number of days using CoreMotion API. The CMPedometer API gives access to startDate and endDate of your last session. I was thinking that an easy way to do this would be to keep a 'tally' of sessions in user defaults (i.e everytime the pedometer tracks your walking the tally increases by 1) and also keeping a sum of endDate - startDate time differences. Then, I would just divide the total time Differences by the tally to get an average walking time.I'm trying to write a simple app that will allo




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: