Swift SDK compiled with Xcode 8 don't work with an application on Xcode 9

Swift SDK compiled with Xcode 8 don't work with an application on Xcode 9


I have compiled some SDK with Xcode 8 on swift 3.

But, I can not use it on Obj-C application if I run it on Xcode 9 (but it work perfectly with Xocde 8)


Normal for some, however, i finded this Apple documentation :

"A target written in Swift 4 can depend on a target that’s written in Swift 3, and vice versa. This means, if you have a large project that’s divided into multiple frameworks, you can migrate your code from Swift 3 to Swift 4 one framework at a time. " (https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Compatibility.html)



There are no mention of Obj-C, so how can I do ?

Answered by QuinceyMorris in 280605022

You can't mix code compiled with different versions of the Swift compiler. Xcode 8 and Xcode 9 have different versions of the Swift compiler. Note that "different version" refers to the entire version number. (For example, Swift versions 4.0.0 and 4.0.1 are different versions.) That's why your code won't work.


However, the statement you quoted isn't referring to different versions of the Swift compiler, but different versions of the Swift language. Roughly, the language version changes when new, incompatible syntax is introduced.


The versions of the Swift compiler in Xcode 9 support language versions 4.0 and 3.2. (Before language version 4 existed, there were language versions 3.0 and 3.1.) So, the way you mix "Swift 4" and "Swift 3" targets in one project is to migrate the "Swift 3" targets to language version 3.2.


But you have to do it all within a single version of Xcode 9.x.

Accepted Answer

You can't mix code compiled with different versions of the Swift compiler. Xcode 8 and Xcode 9 have different versions of the Swift compiler. Note that "different version" refers to the entire version number. (For example, Swift versions 4.0.0 and 4.0.1 are different versions.) That's why your code won't work.


However, the statement you quoted isn't referring to different versions of the Swift compiler, but different versions of the Swift language. Roughly, the language version changes when new, incompatible syntax is introduced.


The versions of the Swift compiler in Xcode 9 support language versions 4.0 and 3.2. (Before language version 4 existed, there were language versions 3.0 and 3.1.) So, the way you mix "Swift 4" and "Swift 3" targets in one project is to migrate the "Swift 3" targets to language version 3.2.


But you have to do it all within a single version of Xcode 9.x.

Swift SDK compiled with Xcode 8 don't work with an application on Xcode 9
 
 
Q