pch中宏颜色+打印定义

(一)pch中宏定义

如下图:


pch中宏颜色+打印定义_第1张图片
图:pch文件


(二)调用:

图:直接调用

(三)代码:


#ifndef PrefixHeader_pch

#define PrefixHeader_pch

//如果oc 执行以下

#ifdef __OBJC__

//日志

#ifdef DEBUG

#define ZWJLog(...)NSLog (__VA_ARGS__)

#else

#define ZWJLog(...)

#endif

//颜色

#define  ZWJColorA(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)/255.0]

#define  ZWJColor(r,g,b) ZWJColorA(r,g,b,255.0);

#define  ZWJRandomColor    ZWJColor(arc4random_uniform(255),arc4random_uniform(255),arc4random_uniform(255))

//国际化:

#define _ZWJLocalizedString(str)  NSLocalizedString(str, nil)

#import "XMGPerson.h"

// Include any system framework and library headers here that should be included in all compilation units.

// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.

#endif

#endif /* PrefixHeader_pch */

















你可能感兴趣的:(pch中宏颜色+打印定义)