OC_pch基本配置(基本宏定义,屏幕适配,自定义输出)

/*
  在工程的TARGETS里边Building Setting中搜索Prefix Header,然后把Precompile Prefix Header右边的NO改为Yes:
  Precompile Prefix Header下边的Prefix Heade填入相对路径
*/
// 相对路径  
// $(SRCROOT)/PopAnimation/pop/Prefix.pch  
  
#import   
  
#ifndef __IPHONE_5_0  
  
#warning "this project uses features only availability in iOS SDK 5.0 and later"  
  
#endif  
  
#ifdef __OBJC__  
  
#import   
#import   
  
#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)  
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)  
  
#define FIT_750_HEIGHT (SCREEN_HEIGHT/667.0)  
#define FIT_750_WIDTH (SCREEN_WIDTH/375.0)  
  
#define iPhone6p ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO)  
#define iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO)  
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)  
#define iPhone4s ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)  
  
#ifdef DEBUG    // 调试阶段  
#define KTLog(...) NSLog(__VA_ARGS__)  
// 输出打印 带有所在的函数以及所在的行数
#define NewKTLog(xx, ...) NSLog(@"%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) 
#else   // 发布阶段 
#define KTLog(...)  
#endif  
  

#endif

你可能感兴趣的:(OC_pch基本配置(基本宏定义,屏幕适配,自定义输出))