我正在构建一个在其中一个方法中使用preprocesor标志的框架.类似下面的代码:
public func heyStuck(overflow: String) { #if DEBUG print(overflow) #else print("¯\\_(ツ)_//¯") #endif }
关键是我使用Cocoapods导入我的框架,所以为了定义框架的标志DEBUG,我必须在我的App Podfile中做这样的事情:
post_install do |installer_representation| installer_representation.pods_project.targets.each do |target| target.build_configurations.each do |config| if config.name != 'Release' config.build_settings['GCC_PREPROCESSOR_DEFinitioNS'] ||= ['$(inherited)','DEBUG=1'] end end end end
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。