The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. Supported values are: 3.0, 4.0, 4.2. This setting can be set in the build settings editor.
出現(xiàn)這個原因是 ,因?yàn)轫?xiàng)目使用了Cocopods,項(xiàng)目是用低版本的Swfit 開發(fā),在Xcode 升級后繼續(xù)開發(fā),這時導(dǎo)入新的庫是依賴高版本的Swift。Cocopods 引入的庫都會有一個Swift版本。
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0'
end
end
end
// 這就話的意思限定每個Pod都是在4.0下編譯