Created
April 14, 2012 02:13
-
-
Save RandyMcMillan/2381583 to your computer and use it in GitHub Desktop.
iOS3 / iOS4 / iOS5 threshold switch
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
NSString* systemVersion = [[UIDevice currentDevice] systemVersion]; | |
BOOL isLessThaniOS4 = ([systemVersion compare:@"4.0" options:NSNumericSearch] == NSOrderedAscending); | |
BOOL isGreaterThaniOS4 = ([systemVersion compare:@"4.0" options:NSNumericSearch] == NSOrderedDescending); | |
BOOL isLessThaniOS5 = ([systemVersion compare:@"5.0" options:NSNumericSearch] == NSOrderedAscending); | |
BOOL isGreaterThaniOS5 = ([systemVersion compare:@"5.0" options:NSNumericSearch] == NSOrderedDescending); | |
if (isLessThaniOS4 && isLessThaniOS5) | |
{ | |
//NSLog(@"isLessThaniOS4 && isLessThaniOS5 = %@",whatever); | |
} | |
if ( isGreaterThaniOS4 && isLessThaniOS5) | |
{ | |
//NSLog(@"isGreaterThaniOS4 && isLessThaniOS5 = %@",whatever); | |
} | |
if (isGreaterThaniOS5) | |
{ | |
//NSLog(@"isGreaterThaniOS5 = %@",whatever); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Convoluted is an understatement...