Created
April 15, 2013 06:06
-
-
Save romyilano/5386018 to your computer and use it in GitHub Desktop.
Check if gyroscope is available... nice macro for detecting iPhone os versions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (BOOL) isGyroscopeAvailable | |
| { | |
| #ifdef __IPHONE_4_0 | |
| CMMotionManager *motionManager = [[CMMotionManager alloc] init]; | |
| BOOL gyroscopeAvailable = motionManager.gyroAvailable; | |
| [motionManager release]; | |
| return gyroscopeAvailable; | |
| #else | |
| return NO; | |
| #endif | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment