swift 仅在调试模式下打印。不在发布模式。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了swift 仅在调试模式下打印。不在发布模式。相关的知识,希望对你有一定的参考价值。

func dPrint(_ items: Any..., separator: String = " ", terminator: String = "\n") {
        
        #if DEBUG
        
        var idx = items.startIndex
        let endIdx = items.endIndex
        
        repeat {
            Swift.print(items[idx], separator: separator, terminator: idx == (endIdx - 1) ? terminator : separator)
            idx += 1
        }
            while idx < endIdx
        
        #endif
    }

以上是关于swift 仅在调试模式下打印。不在发布模式。的主要内容,如果未能解决你的问题,请参考以下文章