I've searched for similar problems but I can't find anyone describing anything quite like this...
I just opened a Swift project after having not looked at it for three years. It was in Swift 3.
When I opened XCode it automatically installed some updates and is now XCode 12.4 (I don't know what it was before).
I understand that I have to migrate my code to at least Swift 4, because Swift 3 is no longer supported.
The first thing I did was go to Edit... Convert... To Current Swift syntax. But I got the error "no target selected" and it would not let me select the target. I found advice online to change the Swift language version. I did this via Build Settings, where there is a dropdown, and I selected Swift 4.0 (it was previously 3.0). This allowed me to select a target for conversion, but then I got the error saying the convert failed, and "Please ensure that all selected targets build successfully with the currently configured Swift version before attempting a migration."
The advice I've seen says that I should first make sure I can build the code before I attempt to migrate. But I can't build it because I get errors saying "SWIFT_VERSION '3.0' is unsupported, supported versions are: 4.0, 4.2, 5.0."
I seem to be stuck between a rock and a hard place: I can't convert the code to Swift 4 because it won't build, but I can't build it because it's not Swift 4!
Do I need to somehow get hold of an older version of XCode, or is there some other solution?
Incidentally I can't now change the Swift language version in Build Settings back to 3.0, because that option is not in the dropdown.