iphoneios7core-motionapple-m7

Utilizing the M7 chip in the iPhone5S


I was wondering if anyone can point me in the right direction with regard to utilzing the M7 chip in the iPhone5S and above.

I was wondering if it's just automagically used when you use general core motion APIs or is there a specific set of APIs to use?

Finally I noted whilst reading some articles online that it keeps some historical movement data, anyone know how to access this or can anyone point me in the right direction?


Solution

  • 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).