“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift.
Xcode 8 seems to be wrongfully displaying a nonexistent ("phantom", if you will) No
. There's a trivial fix for this:
- Click the tiny arrow next to
SWIFT_VERSION
to toggle the drop-down list. - Set the values for
Debug
andRelease
toYes
. - Set the values for
Debug
andRelease
back toNo
.
The image below was taken just after setting Debug
to No
. Xcode shows that both Debug
and Release
are set to No
, however SWIFT_VERSION
reads <Multiple Values>
:
From this, I can only conclude that it is a bug; and that some value (or more probably a null value) is being misrepresented as No
.
“Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift
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.
Use Legacy Swift Language Version - Xcode 8.2
Found work around. I went through each target (and project settings, so both in the project and target) in my project, toggled the "Use Legacy Swift Language Version" from "No" to "Yes" and back to "No" for each. The project then built again.
Xcode 8.3 Swift Version Error (SWIFT_VERSION) In Objective C Project
So the answer to this is to go to the build settings and click the + icon at the top left (as per screen shot below). Then choose to add a User Defined parameter with SWIFT_VERSION
and a value of 3.0
. Build the app and it should run fine.
I also added the following to my Pod file too to automatically do the same process for the pod dependency build settings, although this alone did not resolve the problem:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
Xcode 8 Beta 3 Use Legacy Swift issue
I have been ignoring this problem for a while now and just working on other stuff in the meantime - I finally found the solution to my problem.
Since my project is Objective-C I figured maybe one of the Pods I am using was using Swift, I checked each Pod and none of them were.
The final solution was that my Core Data model was set to generate code in Swift even though I have been manually generating them in the File > New > NSManagedObjectSubclass menu. All I had to do was switch it to Objective-C.
Related Topics
Why Is My Swift Loop Failing with Error "Can't Form Range with End < Start"
Function Taking a Variable Number of Arguments
Swift Draw Shadow to a Uibezier Path
Reading from the Clipboard with Swift 3 on MACos
Add Text Label and Button to Dynamic Tableview Cell Programmatically with Swift
Checking If a Swift Class Conforms to a Protocol and Implements an Optional Function
Cannot Form Weak Reference to Instance of Class Nstextview
Nsurlsession/Nsurlconnection Http Load Failed (Kcfstreamerrordomainssl, -9802)
Is Code Coverage Already Working for Swift
Arkit - How to Put 3D Object on Qrcode
Swift - Lazy Var VS. Let When Creating Views Programmatically (Saving Memory)
How to Highlight a Uitextview's Text Line by Line in Swift
Xcode 11 Doesn't Recognize Core Data Entity
How to Make a Uiview Focusable Using the Focus Engine on Apple Tv
In Swift, When Using "[Weak Self] In", Should I Double Up on It When Nested Inside Another Closure