14

I have searched quite a bit and can't seem to find an answer for this specific problem. I have a project that is a bit older and written in Swift 2. I am trying to convert it to Swift 4, by going to "Edit > Convert > To current Swift Syntax..."

It opens a modal, which is blank inside, at the top says: "No targets to convert found."

I have tried messing around with it, just can't seem to figure this out. Any help is appreciated! Screenshot of what I get here

rmaddy
  • 314,917
  • 42
  • 532
  • 579
vtboyarc
  • 145
  • 2
  • 8
  • 13
    Check the "Swift Language Version" build setting for the target; if it's "Swift 4", then change it to "Swift 3.2" and that should let you run the migration (compare https://stackoverflow.com/q/47210873/2976878). – Hamish Dec 14 '17 at 23:49
  • oh wow - perfect! That fixed it exactly. Thanks so much! – vtboyarc Dec 15 '17 at 00:18
  • Yup. I think the problem for me was I set the project to 4.2 before doing the conversion. I think setting the project to a lower version than the "convert too" version make it available. – Leslie Godwin Jan 31 '19 at 09:44

2 Answers2

3

Use Xcode 10.1 to convert swift 3.0 to swift 4.2, then use Xcode 11.2 to convert swift 4.2 to swift 5.0.

Victor Choy
  • 4,006
  • 28
  • 35
0

If you change the Swift version manually in the target Build settings and after try the Edit/convert option, then Xcode doesn't find any target to convert.

Viker
  • 3,183
  • 2
  • 25
  • 25