iOS开发常用宏定义
// 打印日志
#ifdef DEBUG
// debug模式打印
#define OMGLog(FORMAT, ...) fprintf(stderr,"%s:%d\t%s\n", [[[NSString stringWithUTF8String: __FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat: FORMAT, ## __VA_ARGS__] UTF8String]);
#else
// 打包上前要进行注释
//#define OMGLog(FORMAT, ...) fprintf(stderr, "%s:%d\t%s\n", [[[NSString stringWithUTF8String: __FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat: FORMAT, ## __VA_ARGS__] UTF8String])
#define OMGLog(...)//打包上线解开注释
#endif
#pragma mark - 设备型号识别
#define is_IOS_10 ([[[UIDevice currentDevice] systemVersion] floatValue] >=10.0)
/**
* 颜色快速取值器
*/
#define RGBACOLOR(R,G,B,A) [UIColor colorWithRed:(R)/255.0fgreen:(G)/255.0fblue:(B)/255.0falpha:(A)]
/**
* 十六进制色值
*/
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue &0xFF0000) >>16))/255.0green:((float)((rgbValue &0xFF00) >>8))/255.0blue:((float)(rgbValue &0xFF))/255.0alpha:1.0]
/**
* 获取屏幕的高度
*/
#define kScreenHeight [UIScreen mainScreen].bounds.size.height
/**
* 获取屏幕的宽度
*/
#define kScreenWidth [UIScreen mainScreen].bounds.size.width
/**
* 判断是否为iPad
*/
#define IS_IPAD ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)