Michel
Michel

Reputation: 11753

Convert from Swift 3.0 to Swift 2.3

I have a static library that I converter from old Swift to Swift 2.3 and later to Swift 3.0.

Now I need both version (2.3 and 3.0) of the library, but I forgot to take a backup of version 2.3. And I only have 3.0.

Is there a simple way to convert back from Swift 3.0 to Swift 2.3?

Upvotes: 0

Views: 468

Answers (1)

CodeBender
CodeBender

Reputation: 36612

Simple, not really, but this will work.

  1. If you don't have it, download XCode 7.3.1 from Apple
  2. Open your library in the 7.3.1 version and correct whatever errors appear
  3. Migrate the corrected code from step 2 into XCode 8.2 or lower (8.3 will not support Swift 2.3)

As mentioned in the comments, maintaining your code in a version control system will spare you problems like this in the future, and is generally just a good idea.

You don't even need to set up your own system, since git is part of MacOS, and XCode can handle simple git features for you.

enter image description here

Upvotes: 2

Related Questions