Skip to content

Instantly share code, notes, and snippets.

@motoishmz
Last active December 17, 2015 09:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save motoishmz/5591099 to your computer and use it in GitHub Desktop.
Save motoishmz/5591099 to your computer and use it in GitHub Desktop.
#define RGB(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1]
#define RGBA(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define IS_RETINA [[UIScreen mainScreen] scale] > 1.0
#define LANGUAGE ([NSLocale preferredLanguages][0])
#define SCREEN_BOUNDS ([UIScreen mainScreen].bounds)
#ifdef DEBUG
# define LOG_CURRENT_LINE(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
# define LOG_CURRENT_LINE(...)
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment