Skip to content

Instantly share code, notes, and snippets.

@a-v-ebrahimi
Created November 29, 2012 11:32
Show Gist options
  • Save a-v-ebrahimi/4168385 to your computer and use it in GitHub Desktop.
Save a-v-ebrahimi/4168385 to your computer and use it in GitHub Desktop.
iOS : Auto select image for Retina 4
#define isPhone568 ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 568)
#define iPhone568ImageNamed(image) (isPhone568 ? [NSString stringWithFormat:@"%@-568h.%@", [image stringByDeletingPathExtension], [image pathExtension]] : image)
#define iPhone568Image(image) ([UIImage imageNamed:iPhone568ImageNamed(image)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment