Skip to content

Instantly share code, notes, and snippets.

@satoshin2071
Last active December 29, 2015 01:59
Show Gist options
  • Save satoshin2071/7596884 to your computer and use it in GitHub Desktop.
Save satoshin2071/7596884 to your computer and use it in GitHub Desktop.
[ObjC][便利系]iOS判定マクロ
//OS判定
#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)
//iOS7.x以上か?
#define isiOS7 SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment