Last active
August 29, 2015 14:20
-
-
Save r-dent/4b50da5a52bd7d083153 to your computer and use it in GitHub Desktop.
iOS Macros
This file contains 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
#define IS_iOS_8 [[[UIDevice currentDevice] systemVersion] hasPrefix:@"8"] | |
#define IS_iPad UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad | |
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) | |
#define IS_IPHONE_4S_AND_LOWER (IS_IPHONE && MAX([UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width) == 480.0) | |
#define IS_IPHONE_5 (IS_IPHONE && MAX([UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width) == 568.0) | |
#define IS_iPhone6 (IS_IPHONE && MAX([UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width) == 667) | |
#define IS_iPhone6Plus (IS_IPHONE && MAX([UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width) == 736) | |
#define DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * M_PI) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment