1.UIColor--16进制
#define UIColorFromHex(s,alp) [UIColor colorWithRed:(((s & 0xFF0000) >> 16))/255.0 green:(((s &0xFF00) >>8))/255.0 blue:((s &0xFF))/255.0 alpha:alp]
2.屏幕尺寸
#define ScreenWidth [UIScreen mainScreen].bounds.size.width
#define ScreenHeight [UIScreen mainScreen].bounds.size.height
3.状态栏高度和导航栏高度
#define StatusBarHeight [[UIApplication sharedApplication] statusBarFrame].size.height;
#define NavBarHeight self.navigationController.navigationBar.frame.size.height;
4.设置随机颜色
#define QSRandomColor [UIColor colorWithRed:arc4random_uniform(256)/255.0 green:arc4random_uniform(256)/255.0 blue:arc4random_uniform(256)/255.0 alpha:1.0]
5.弱引用/强引用
#define QSWeakSelf(type) __weak typeof(type) weak##type = type;
#define QSStrongSelf(type) __strong typeof(type) type = weak##type;
6.自定义NSLog
#ifdef DEBUG
#define QSLog(...) NSLog(@"%s 第%d行 \n %@\n\n",__func__,__LINE__,[NSString stringWithFormat:__VA_ARGS__])
#else
#define QSLog(...)
#endif
7.系统版本
#define iOSversionFloat [[[UIDevice currentDevice] systemVersion] floatValue]