由于更新了xCode,导致以前一些第三方的swift版本出错,这种情况我们可以在Podfile中指定我们需要的swift版本,在Podfile中的最后面(即end之后)添加一下代码
# Swift 版本声明
post_install do |installer|
installer.pods_project.targets.each do |target|
if ['对应三方1', '对应三方2'].include? target.name
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.3'
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
end
else
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.1'
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
end
end
end
end
网友评论