Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module compiled with Swift 3.0 cannot be imported in Swift 2.3

Tags:

xcode

ios

swift

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.

like image 615
Bartłomiej Semańczyk Avatar asked Aug 26 '16 08:08

Bartłomiej Semańczyk


Video Answer


1 Answers

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.

like image 163
Eugen Dimboiu Avatar answered Sep 17 '22 19:09

Eugen Dimboiu