Created
September 16, 2014 14:57
-
-
Save Air-Craft/8b7fcdde82a7759aeb19 to your computer and use it in GitHub Desktop.
Detect iOS version (iOS8 and old version) #ios #versioning #basic
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
| // iOS >=8 | |
| NSOperatingSystemVersion ios8_0_0 = (NSOperatingSystemVersion){8, 0, 0}; | |
| if ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:ios8_0_0]) { | |
| // iOS 8 logic | |
| } else { | |
| // iOS 7 and below logic | |
| } | |
| // iOS <=7 | |
| if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) { | |
| // Load resources for iOS 6.1 or earlier | |
| } else { | |
| // Load resources for iOS 7 or later | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment