Last active
December 18, 2015 11:49
-
-
Save lennypham/5778085 to your computer and use it in GitHub Desktop.
Test for iOS version
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
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 MY_MACRO_NAME (DeviceSystemMajorVersion() < 7) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment