Bartłomiej Semańczyk Bartłomiej Semańczyk - 2 months ago 202
iOS Question

Module compiled with Swift 3.0 cannot be imported in Swift 2.3

This is what I do:

import BSTableViewReorder


and get the following error:


Module compiled with Swift 3.0 cannot be imported in Swift 2.3


What can I do to make it compile? I did:

Edit > Convert -> Current Swift Syntax


Using Xcode 8 and macOS Sierra.

For Both: the target and the project I have the following settings of
Use Legacy Swift Language Version


enter image description here
enter image description here

The project is my pod for cocoapods dependencies. I just converted project to Swift 3.0 but it does not compile.

Answer

You'll need to change the Use Legacy Swift Language Version to NO - this makes sure your project will use swift 3.

If you want to package your project as a POD (for cocoapods) you'll need to add a file named .swift-version (containing 1 single line, "3.0"). This will tell cocoapods to use the swift 3 compiler.

Everything should work after this changes.