Skip to content

Instantly share code, notes, and snippets.

@championofblocks
Created March 21, 2014 10:38
Show Gist options
  • Save championofblocks/9683519 to your computer and use it in GitHub Desktop.
Save championofblocks/9683519 to your computer and use it in GitHub Desktop.
iOS System Version Checks
#if TARGET_OS_IPHONE
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment