4

I just upgraded my code from Swift 3 to Swift 4. Later, I changed my mind and wanted to use my code with iOS 10. Then I got this error:

“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.

I used the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version but then it said

'No Filter Results'.

Then, I tried to use Build Settings and changed 'SWIFT_VERSION' from 4.0 to 3.1 and also 3.0. However, the error persisted. Does anyone know a solution to this? Thanks in advance!

3
  • 8
    Hopefully you keep your project committed to source control such as git. Reverting in git seems like the best option you have. Jun 13, 2017 at 14:36
  • Create new project and add your source files there.
    – Sulthan
    Jun 13, 2017 at 14:40
  • .. at least, there is no reason why the swift 4 can not be used on iOS10 Jun 13, 2017 at 14:44

1 Answer 1

9

Clean your project (CMD + Shift + K) and make sure the SWIFT_VERSION on every target is set to Swift 3 using Xcode 8.3.3

3
  • got a prompt which states: The document "Main.storyboard" requires Xcode 9.0 or later Is there another adjustment to make for IB? Oct 10, 2017 at 17:20
  • 1
    You'll have to open the storyboard as source code and delete the xcode 9 line. Oct 10, 2017 at 17:28
  • life saver! Thank you Oct 10, 2017 at 18:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.