Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build Swift 3 project on Xcode 9?

Xcode 9 Release Notes says that Swift 3 compilation is supported:

One compiler for Swift 4 and Swift 3, Swift 4 and Swift 3 targets can be compiled together in the same project.

I have installed Xcode 9 beta. But when I press Build it shows bunch of errors. Are some special preparations need to do when use Swift 3 in Xcode 9?

UPD: Module compiled with Swift 3.1 cannot be imported in Swift 4.0

Module compiled with Swift 3.1 cannot be imported in Swift 4.0

like image 262
Exey Panteleev Avatar asked Jun 06 '17 12:06

Exey Panteleev


People also ask

How do I create a Swift project in Xcode?

To create a new Swift package, open Xcode and select File > New > Swift Package. Choose a name and select a file location. Select “Create Git repository on my Mac” to put your package under version control. On completion, the Swift package opens in Xcode and looks similar to a standard Xcode project.

Which Xcode supports swift3?

Swift 3 is the primary development language supported within Xcode 8 so there are a couple notes to consider if you chose to continue using Swift 2.3. First, Swift 2.3 and Swift 3 are not binary compatible so your app's entire code base needs to pick one version of Swift.

How do I move Swift version in Xcode?

When you open your project with Xcode 10.2 for the first time, you will see a migration opportunity item in the Issue Navigator: click it to activate a sheet asking you if you'd like to migrate. You can be reminded later or invoke the Migrator manually from the menu Edit -> Convert -> To Current Swift Syntax…


1 Answers

Select the target, goto Build Settings > Swift Language Version:

enter image description here

like image 150
vadian Avatar answered Nov 06 '22 15:11

vadian