//狀態欄高度
#define kStatusBarHeight [[UIApplication sharedApplication] statusBarFrame].size.height
//十六進制
#define UIColorFromHexadecimalRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define UIColorFromHexadecimalRGBA(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:a]
//十進制
#define UIColorFromRGB(r,g,b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define UIColorFromRGBA(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:a]
#if DEBUG
//只在測試環境下執行
#endif
#if RELEASE
//只在線上環境下執行
#endif
#define NSLog(FORMAT, ...) fprintf(stderr,"\nfunction:%s line:%d content:%s\n", __FUNCTION__, __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
//主線程調用方法
#define CallForMainQueue(__function__)\
if([NSThread isMainThread]){\
__function__;\
}\
else\
{\
dispatch_sync(dispatch_get_main_queue(),^{\
__function__;\
});\
}\
//全局隊列異步調用方法
#define CallForAsyncQueue(__function__)(\
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),^{\
__function__;\
})\
)
#define kShortVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
#define kWeak(obj) __weak typeof(obj) weak##obj = obj
#define kStrong(obj) __strong typeof(obj) strong##obj = weak##obj;
#define kDocumentPath [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]
``