// 单例
#define SINGLETON_FOR_CLASS(classname) \
\
+ (classname*) shareInstance \
{ \
static dispatch_once_t pred = 0; \
__strong static classname* _sharedObject = nil; \
dispatch_once(&pred, ^{ \
_sharedObject = [[self alloc] init]; \
}); \
return _sharedObject;\
}
// 16进制颜色转为RGB
#define UIColorFromHex(hexColor) [UIColor colorWithRed:(((hexColor & 0xFF0000) >> 16 )) / 255.0 green:((( hexColor & 0xFF00 ) >> 8 )) / 255.0 blue:(( hexColor & 0xFF )) / 255.0 alpha:1.0]
#define StatusBar_Height [UIApplication sharedApplication].statusBarFrame.size.height // 状态栏高度
#define NaviBar_Height self.navigationController.navigationBar.frame.size.height // 导航栏高度
#define Screen_Width MIN([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) // 屏幕宽度
#define Screen_Height MAX([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) // 屏幕高度