Skip to content

Instantly share code, notes, and snippets.

@dmiedema
Last active December 29, 2015 23:59
Show Gist options
  • Save dmiedema/7746469 to your computer and use it in GitHub Desktop.
Save dmiedema/7746469 to your computer and use it in GitHub Desktop.
Objective C Macro-Manifest I want to keep around
#define DM_rgba(r,g,b,a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]
#define DM_rgb(r,g,b) DM_rgba(r, g, b, 1.0f)
#define DM_isIPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define DM_isIPhone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define DM_isIPhone5 ([[UIScreen mainScreen] bounds].size.height == 568)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment