//獲取屏幕的寬度嗡害、高度
#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height
//適配比例纺荧,以iphone6尺寸為基準(zhǔn)
#define wl ([UIScreen mainScreen].bounds.size.width/375)
#define hl ([UIScreen mainScreen].bounds.size.height/667)
//DEBUG模式下打印日志
#ifdef DEBUG
#define HLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define HLog(...)
#endif
//獲取系統(tǒng)版本
#define IOS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]
//判斷設(shè)備操作系統(tǒng)是否為iOS7
#define? IOS7 ([[UIDevice currentDevice].systemVersion doubleValue] >=7.0)
//RGB顏色轉(zhuǎn)換 (16進(jìn)制->10進(jìn)制)
#define UIColorFromRGBA(rgbValue, alphaValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0x00FF00) >> 8))/255.0 blue:((float)(rgbValue & 0x0000FF))/255.0 alpha:alphaValue]
//RGB顏色
#define RGBACOLOR(R,G,B,A) [UIColor colorWithRed:(R)/255.0 green:(G)/255.0 blue:(B)/255.0 alpha:(A)]
#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0f]
//整體背景色
#define BACKGROUND_COLOR [UIColor colorWithRed:242.0/255.0 green:236.0/255.0 blue:231.0/255.0 alpha:1.0]
//清除背景色
#define CLEARCOLOR [UIColor clearColor]
#define WHITECOLOR [UIColor whiteColor]
//整體字體顏色,大小
#define TEXT_COLOR [UIColor colorWithRed:(51)/255.0 green:(71)/255.0 blue:(113)/255.0 alpha:1.0]
#define TEXT_FONT? [UIFont systemFontOfSize:14*hl]
#define Text_Font? [UIFont systemFontOfSize:12*hl]
//方正黑體簡(jiǎn)體字體定義
#define FONT(F) [UIFont fontWithName:@"FZHTJW--GB1-0" size:F]
//定義一個(gè)API
#define APIURL @""
//GCD
#define BACK(block) dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block)
#define MAIN(block) dispatch_async(dispatch_get_main_queue(),block)
//NSUserDefaults 實(shí)例化
#define USER_DEFAULT [NSUserDefaults standardUserDefaults]
//由角度獲取弧度 有弧度獲取角度
#define angleToRadian(x) (M_PI*(x)/180.0)
#define radianToAngle(r) (r*180.0)/M_PI
//block塊呢,self->weakSelf
#define WeakSelf __weak typeof(self) weakSelf = self;
自己常用的一些宏定義,拿出來(lái)記錄一下,分享一下,萬(wàn)一有人需要呢!肋拔!