This sample code and the related talk are based on code from Peripatetic, which is now available in the App Store.
This project contains demos of some of the Core Motion APIs available in iOS 8 which I created for a talk at PDX CocoaHeads:
- Real-time Motion Activity (this was introduced in iOS 7, but the
bicycling
property is new) - Real-time pedometer
- Historical pedometer
- Altimeter
- CLFloor (which is CoreLocation, but I added it here so I can check for defined floors while I'm wandering the world)
Some features will work on an iPhone 5s, but running the app on an iPhone 6 or 6 Plus is the best option. It won't do much on a simulator.
CoreMotion Framework Reference
WWDC 2014 Session 612: Motion Tracking with the CoreMotion Framework (AsciiWWDC)
Sample code from that session: MotionActivityDemo
A deeper exploration of ways to access magnetometer data
MIT