这就是我在Podfile
中所做的事情:
post_install do |installer|
installer.pods_project.targets.each do |pod|
pods = { 'CDMarkdownKit': '4.0', 'MessageKit': '4.0', 'LocalizationKit': '4.0', 'RxKeyboard': '4.0', 'JWTDecode': '3.1'}
if pods.keys.include?(pod.name)
pod.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = pods[pod.name]
end
end
end
end
end
但这不起作用。我不知道为什么。怎么了?
答案 0 :(得分:1)
您应该对值使用符号。更新的代码如下:
post_install do |installer|
installer.pods_project.targets.each do |pod|
pods = {'CDMarkdownKit': '4.0', 'MessageKit': '4.0', 'LocalizationKit': '4.0', 'RxKeyboard': '4.0', 'JWTDecode': '3.1'}
if pods.has_key?(pod.name.to_sym)
pod.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = pods.values_at(pod.name.to_sym)
end
end
end
end