I just did the last Xcode update (8.3), and I have the message :
“Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
Knowing that the "Use Legacy Swift Language Version" option has just been removed from the build settings, how can I generate my app in Swift 2.3 without doing any conversion for now ?
In the navigator selection bar, click the magnifying glass, then search for "SWIFT_VERSION
" You will find the places in the project where you can adjust the swift version accordingly.
You can't. XCode 8.2 was the last version to support Swift 2.3. You have to either update to Swift 3 or use Xcode 8.2.
In My case I selected Pod and changed swift version for specific pod. This works for me.
To programmatically change swift version of pods, you may add this inside your Podfile
post_install do |installer|
installer.pods_project.targets.each do |target|
if ['Alamofire','OtherPod','AnotherPod'].include? target.name
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0'
end
end
end
end
In Swift 4, if you are using objective-c as well,
you may turn on @objc inference so the swift project will run properly on objective-c.
post_install do |installer|
installer.pods_project.targets.each do |target|
if ['Alamofire','OtherPod','AnotherPod'].include? target.name
target.build_configurations.each do |config|
config.build_settings['SWIFT_SWIFT3_OBJC_INFERENCE'] = 'On'
end
end
end
end
You cannot as XCode 8.2 was the last version to support Swift 2.3. You will have to either update your code to Swift 3 or use Xcode 8.2.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With