Skip to content

Instantly share code, notes, and snippets.

@darkseed
Forked from steipete/gist:1239338
Created September 24, 2011 16:11
Show Gist options
  • Save darkseed/1239494 to your computer and use it in GitHub Desktop.
Save darkseed/1239494 to your computer and use it in GitHub Desktop.
PSIsCrappyDevice
BOOL PSIsCrappyDevice(void) {
static BOOL isCrappyDevice = YES;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
BOOL isSimulator = NO;
BOOL isIPad2 = (PSIsIpad() && [UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]);
BOOL hasRetina = [[UIScreen mainScreen] scale] > 1.f;
// enable animations on simulator
#if TARGET_IPHONE_SIMULATOR
isSimulator = YES;
#endif
if (isIPad2 || hasRetina || isSimulator) {
isCrappyDevice = NO;
}
});
return isCrappyDevice;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment