Created
October 4, 2013 09:37
-
-
Save objectiveSee/6823453 to your computer and use it in GitHub Desktop.
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
@implementation UIDevice (EAAdditions) | |
+ (BOOL)isFourInch | |
{ | |
static dispatch_once_t onceToken; | |
static BOOL itIs = NO; | |
dispatch_once(&onceToken, ^{ | |
CGRect screenBounds = [[UIScreen mainScreen] bounds]; | |
if (screenBounds.size.height == 568) { | |
itIs = YES; | |
} | |
}); | |
return itIs; | |
} | |
+ (BOOL)isSimulator { | |
#if (TARGET_IPHONE_SIMULATOR) | |
return YES; | |
#else | |
return NO; | |
#endif | |
} | |
+ (BOOL)isIOS7 { | |
return ( [[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0 ); | |
} | |
+ (BOOL)isRetina | |
{ | |
return ([UIScreen mainScreen].scale >= 2.0); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment