Remove println() for release version iOS Swift

前端 未结 19 1381
被撕碎了的回忆
被撕碎了的回忆 2020-11-29 15:55

I would like to globally ignore all println() calls in my Swift code if I am not in a Debug build. I can\'t find any robust step by step instructions for this a

相关标签:
19条回答
  • 2020-11-29 16:59

    Even simpler, after making sure -D DEBUG is set for the OTHER_SWIFT_FLAGS Debug build settings:

    #if !DEBUG
        func print(_ items: Any..., separator: String = " ", terminator: String = "\n") { }
    #endif
    
    0 讨论(0)
提交回复
热议问题