Created
January 29, 2015 06:30
-
-
Save binderclip/17b64a2688b5c676226c to your computer and use it in GitHub Desktop.
Returns the major version of iOS, from Apple Samplecode: DateCell
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
/*! Returns the major version of iOS, (i.e. for iOS 6.1.3 it returns 6) | |
*/ | |
NSUInteger DeviceSystemMajorVersion() | |
{ | |
static NSUInteger _deviceSystemMajorVersion = -1; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
_deviceSystemMajorVersion = | |
[[[[UIDevice currentDevice] systemVersion] componentsSeparatedByString:@"."][0] integerValue]; | |
}); | |
return _deviceSystemMajorVersion; | |
} | |
#define EMBEDDED_DATE_PICKER (DeviceSystemMajorVersion() <= 7) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment