2 Replies
      Latest reply: Oct 4, 2016 10:36 AM by iamcR RSS
      Henry Tsai. Level 1 Level 1 (0 points)

        Hi, I can't find any information in document about this. Basically I have a main app target written in SWIF 2.3 and I have a new extension that I want it be written in SWIFT 3. but i am getting following error while tryining compile app with this configuration. My question is " is it possible to mix two different swift version of code in same bundle?"

        "The following binaries use incompatible versions of Swift"

        • Re: Mixing SWIF 2.3 and SWIFT in same project
          KMT Level 8 Level 8 (9,310 points)

          Use of Swift 3 tools typicall expect migration from 2.x.

          • Re: Mixing SWIF 2.3 and SWIFT in same project
            iamcR Level 1 Level 1 (0 points)

            Hi Henry,

             

            First, all code has to be in the same swift version. That being said, one way you could solve the problem is by sticking to Swift 2.3 and then setting your Extension Target's Use Legacy Swift Language Version to "Yes".

             

            You can find that option while Xcode 8 is open as follows:

             

            1. Select your (container) app project root in the Project Navigator (on the left-hand side)
            2. On the right-hand side, select your extension under the TARGETS section
            3. Once the extension is selected, click on the Build Settings tab
            4. Scroll down and find Use Legacy Swift Language Version and set it to Yes
            5. You can now build the project