//打印宏 #if DEBUG public let CHDebugLog = { (items: Any...) in print(items) } #else public let CHDebugLog = { (items: Any...) in } #endif
在xcode中设置debug模式下开启打印宏,如下图
//打印宏 #if DEBUG public let CHDebugLog = { (items: Any...) in print(items) } #else public let CHDebugLog = { (items: Any...) in } #endif