From the course: Advanced iOS App Development: Core Motion

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Pull pace and distance

Pull pace and distance - iOS Tutorial

From the course: Advanced iOS App Development: Core Motion

Start my 1-month free trial

Pull pace and distance

- [Instructor] Besides steps, there's other properties of pedometers. I've selected two more to show on our pedometer, average pace and distance. Speed and distance measurements are a joint effort of core motion and core location. For best use of power, the pedometer most often uses the distance of a user's footstep, measured as an armswing. Most of the time, the CM pedometer class multiplies that distance from the number of steps. Periodically, the pedometer uses locations to recalibrate the step size, without you doing any extra work. Let's see how to add these from the pedometer class's properties. Close the console. First, we'll add a new property. Var, pedometer, data equals core motion pedometer data. The CM pedometer data class contains the movement stats for pedometers. Option click on the CM pedometer data class, and click class reference. You'll get a list of properties that you could use in the pedometer. All of it is of type NS number, and all but number of steps are…

Contents