Reputation: 9434
When I opened my project in Xcode 10.2, I got this message:
Unsupported Swift Version …Use Xcode 10.1 to migrate the code to Swift 4.
Where can I still find Xcode 10.1? So the process is to have 2 versions of Xcode, first migrate to Swift 4 then 5?
PS: If I migrate the code to Swift 5, does the app still bundle Swift binary? If yes, then what's the benefits since the app still bundle Swift binary? If no, then how does it handle iOS 11.x?
Upvotes: 8
Views: 14701
Reputation: 19592
I just ran into this problem with an old Cocoapod file that is written in Swift 3 but my Xcode supports Swift 5. There is no need to download Xcode 10.1. I followed this Apple Forums answer which works fine.
1- When you open project, you get this alert:
2- Select OK and open Issues Navigator (press command button + 5). It's the blue triangle icon
3- Find the yellow triangle warning for project, click each one, then when the alert appears validate changes when requested.
4- You should then get a compilation error, with Swift version undefined:
5- In the Project Navigator (left pane), select the blue project icon:
6- Select Build Settings
and make sure that underneath of it, it's set to All
and Combined
7- In the right search bar enter Swift Language
. The result should say Swift Language Version
- Unspecified
:
8- Just click Unspecified
and change it to Swift 5
9- In the 8th pic above, on the left side the TARGETS
section is on the first target that says Audio Mixer Demo. You're gong to have to do the same thing to Audio Mixer DemoTests because it's also initially set to Unspecified
. The Swift Language
for that is going to need to change to Swift 5
.
10- Fix all the red errors that are going to appear
Upvotes: 1
Reputation: 391
You need to redownload Xcode 10.1 from this page, convert your code to Swift 4, then redownload Xcode 10.2 and convert to Swift 5.
The only other option I can think of is changing your Swift Version in your apps bundle and then seeing if it lets you convert but I don't think it will.
Upvotes: 13