swift #if

作者: yxibng | 来源:发表于2019-07-31 18:58 被阅读0次

参考:https://stackoverflow.com/questions/45484715/swift-multiple-targets-handling-macros-not-working

For Xcode 8 and above, use Active Compilation Conditions setting in Build settings / Swift compiler - Custom flags.

This is the new build setting for passing conditional compilation flags to the Swift compiler. Simply add flags like this: GOLD, SILVER etc. without -D etc. Then check it with compilation conditions like this:

#if GOLD
//
#elseif SILVER
//
#else
//
#endif
image.png

相关文章

网友评论

      本文标题:swift #if

      本文链接:https://www.haomeiwen.com/subject/lifxdctx.html