Skip to content

Instantly share code, notes, and snippets.

@romyilano
Created April 15, 2013 06:06
Show Gist options
  • Select an option

  • Save romyilano/5386018 to your computer and use it in GitHub Desktop.

Select an option

Save romyilano/5386018 to your computer and use it in GitHub Desktop.
Check if gyroscope is available... nice macro for detecting iPhone os versions
- (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