Skip to content

Instantly share code, notes, and snippets.

@vitoziv
Created December 11, 2013 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vitoziv/7906020 to your computer and use it in GitHub Desktop.
Save vitoziv/7906020 to your computer and use it in GitHub Desktop.
IS IOS7 Version
NSUInteger DeviceSystemMajorVersion();
NSUInteger DeviceSystemMajorVersion()
{
static NSUInteger _deviceSystemMajorVersion = -1;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_deviceSystemMajorVersion = [[[[[UIDevice currentDevice] systemVersion] componentsSeparatedByString:@"."] objectAtIndex:0] intValue];
});
return _deviceSystemMajorVersion;
}
#define IS_IOS_7 (DeviceSystemMajorVersion() >= 7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment