Skip to content

Instantly share code, notes, and snippets.

@steipete
Created September 24, 2011 13:44
Show Gist options
  • Save steipete/1239338 to your computer and use it in GitHub Desktop.
Save steipete/1239338 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;
}
@steipete
Copy link
Author

The latest iPod touch now has an A4 and retina, so it returns YES there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment