Skip to content

Instantly share code, notes, and snippets.

@rbaulin
Last active December 25, 2015 11:09
Show Gist options
  • Save rbaulin/6967228 to your computer and use it in GitHub Desktop.
Save rbaulin/6967228 to your computer and use it in GitHub Desktop.
Urgent macros
#define IS_7_0 (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1)
#define IS_PAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define IS_PHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_IPHONE_5 (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 568.0f)
#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]
#ifdef DEBUG
# define LOG_MESSAGE(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
# define LOG_MESSAGE(...)
#endif
#define DENY_APPSTORE
#ifdef APPSTORE
#define DENY_APPSTORE REJECTED
#endif
// also useful in code
BOOL IS_GRE_8_0 = (&UIApplicationOpenSettingsURLString);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment