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

// 相对路径
// $(SRCROOT)/PopAnimation/pop/Prefix.pch

#import <Availability.h>

#ifndef __IPHONE_5_0

#warning "this project uses features only availability in iOS SDK 5.0 and later"

#endif

#ifdef __OBJC__

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>

#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__)
#else   // 发布阶段
#define KTLog(...)
#endif

#endif


输出打印 带有所在的文件名以及所在的行数

#define NewKTLog(xx, ...) NSLog(@"%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)


你可能感兴趣的:(ios,宏定义,屏幕适配,pch文件,自定义输出)