Search code examples
iphoneobjective-ciosbackwards-compatibilitycore-motion

Can I use the Core Motion framework on pre iOS 4 devices?


I know that the framework was introduced in iOS 4 with the gyro. But is Core Motion backward-compatible? Or I am restricted to use UIAcceleration?

Does this imply that either I can't use the gyro or can't support earlier devices?


Solution

  • The Core Motion framework is not available on pre 4.0 devices so you should wrap all related code into a runtime check to see if the class exists which is the recommended way according to Apple.