Skip to content

Instantly share code, notes, and snippets.

@MrBoog
Created March 13, 2014 14:14
Show Gist options
  • Save MrBoog/9529280 to your computer and use it in GitHub Desktop.
Save MrBoog/9529280 to your computer and use it in GitHub Desktop.
SYSTEM_VERSION
//iOS7
#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)
#define RESIZEWITHIOS7(content) if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7")) {\
content.top += 20;\
}
#define RESIZEWITHIOS7_HEIGHT(content) if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7")) {\
content.top += 20;\
content.height -= 20;\
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment