pch文件的使用

#ifdef __OBJC__

#import "UIView+Frame.h"

#import "UIImage+Image.h"

#define SKKeyWindow [UIApplication sharedApplication].keyWindow

// 在发布的时候

    // 如果一个空间的字体是模型决定的,要设置他的文字颜色,要通过富文本

// ...表示宏定义的可变参数

// __VA_ARGS__:表示函数里面的可变参数

#ifdef DEBUG // 是不是DEBUG调试

// 定义自己的Log

#define SKLog(...) NSLog(__VA_ARGS__)

#else // 发布

#define SKLog(...)

#endif

#endif

#ifdef  __OBJC__ // 为了屏蔽C语言

 

        #ifndef PrefixHeader_pch

        #define PrefixHeader_pch

 

        #define RandomColor [UIColor colorWithRed:arc4random_uniform(256)/255.0 green:arc4random_uniform(256)/255.0 blue:arc4random_uniform(256)/255.0  alpha:1.0]

 

            #if DEGUG

            #define MJLog(...) NSLog(__VA__ARGS__)

            #else

            #define MJLog(...)

            #endif

 

        #endif 

 

        // 导入很多个文件到要使用的类

        #import "Tool.h"

 

#endif

原文地址:https://www.cnblogs.com/1018475062qq/p/6266778.html