O'Reilly logo

Mastering iOS 10 Programming by Donny Wals

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing CoreMotion

The CoreMotion framework implements many motion-related classes. The functionality for these classes varies from counting steps with CMStepCounter to figuring out the user's altitude with CMAltimeter to accessing gyroscope data with CMGyroData or even to reading whether a user is walking, running, or driving with CMMotionActivityManager. Reading the hardware sensors, such as the gyroscope, is done through an instance of CMMotionManager. The motion manager class provides an interface that enables developers to read data from the accelerometer, gyroscope, and more.

Our application will use a combination of sensors to function properly. However, before we get to that, we'll explore the available sensors a bit more because there ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required