The two main classes you're looking for are CMMotionActivityManager
and CMMotionActivity
. The first lets you query historical data and manage motion in general. The second gives you access to different, more specific types of motion.
These two classes are available only on iOS 7. Use -[CMMotionActivityManager isActivityAvailable]
to determine if motion is available first. I have not found any documentation on it, but my guess is that method will only return YES
on devices that have the M7 chip (or future chips that support motion activity reporting).