苹果每年都更新 Swift 版本,但是平常项目中使用的一些开源库却不能及时更新,使用那就需要一部分库继续使用 Swift3.2 版本,一部分使用 Swift4,那么在 Podfile 中应该这么写:
# Swift 版本声明 post_install do |installer| installer.pods_project.targets.each do |target| if [‘库名‘,‘nelsen‘].include? target.name target.build_configurations.each do |config| config.build_settings[‘SWIFT_VERSION‘] = ‘4.0‘ config.build_settings[‘ONLY_ACTIVE_ARCH‘] = ‘NO‘ end else target.build_configurations.each do |config| config.build_settings[‘SWIFT_VERSION‘] = ‘3.2‘ config.build_settings[‘ONLY_ACTIVE_ARCH‘] = ‘NO‘ end end end end总结
以上是内存溢出为你收集整理的CocoaPods 给每个库单独指定 Swift 版本全部内容,希望文章能够帮你解决CocoaPods 给每个库单独指定 Swift 版本所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)