Skip to content

Instantly share code, notes, and snippets.

@MattFoley
Created February 13, 2013 16:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save MattFoley/4945666 to your computer and use it in GitHub Desktop.
Save MattFoley/4945666 to your computer and use it in GitHub Desktop.
Helpful PCH Macros.
#define screenHeight() ([UIScreen mainScreen].bounds.size.height)
#define isPhoneFive() (screenHeight() == 568)
#define isOS6() ([[[UIDevice currentDevice] systemVersion]intValue] > 5.2)
#define UIInterfaceIdiomIsPad() (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define UIColorFromRGB(rgbValue) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment