配置PCH文件路径
$(SRCROOT)/$(PRODUCT_NAME)/PrefixHeader.pch
PCH文件
#ifdef __OBJC__
//导入头文件
//宏定义
/**获取系统对象*/
#define kApplication [UIApplication sharedApplication]
#define kAppWindow [UIApplication sharedApplication].delegate.window
#define kAppDelegate [AppDelegate shareAppDelegate]
#define kRootViewController [UIApplication sharedApplication].delegate.window.rootViewController
#define kUserDefaults [NSUserDefaults standardUserDefaults]
#define kNotificationCenter [NSNotificationCenter defaultCenter]
/**iphone6的*/
#define Iphone6ScaleWidth KScreenWidth/375.0
#define Iphone6ScaleHeight KScreenHeight/667.0
/**根据ip6的屏幕来拉伸*/
#define kRealValue(with) ((with)*(KScreenWidth/375.0f))
/**强弱引用*/
#define kWeakSelf(type) __weak typeof(type)weak##type = type;
#define kStrongSelf(type)__strong typeof(type)type = weak##type;
//View圆角和加边框
#define ViewBorderRadius(View,Radius,Width,Color)\
\
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES];\
[View.layer setBorderWidth:(Width)];\
[View.layer setBorderColor:[Color CGColor]]
/**屏幕的Bounds*/
#define SCREEN_RECT [[UIScreen mainScreen] bounds]
/**屏幕的高度*/
#define SCR_HEIGHT [[UIScreen mainScreen]bounds].size.height
/**屏幕的宽度*/
#define SCR_WIDTH [[UIScreen mainScreen]bounds].size.width
/**tabBar高度*/
#define TABBAR_HEIGHT 49
/**navBar高度*/
#define NAVBAR_HEIGHT ([[[UIDevice currentDevice] systemVersion] floatValue] < 7.0 ? (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 64:44):(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 64:64))
/**当前版本号*/
#define CURRENT_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]
/**大于等于7.0的ios版本*/
#define iOS7_OR_LATER SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")
/**大于等于8.0的ios版本*/
#define iOS8_OR_LATER SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")
//自定义log输出
#ifdef DEBUG // 在开发阶段
#define NSLog(fat, ...) NSLog((@"%s [Line %d] " fat), __FUNCTION__, __LINE__, ##__VA_ARGS__)
#else // 非开发阶段, 也就意味着 打包上架阶段 releas
#define NSLog(...)
#endif
#endif