If you now execute the swift -version command, you should see the same output we saw when we executed the xcrun swift -version command. This command points you to the location of the REPL (Read Eval Print Loop) for Swift on your machine. Open a terminal window and execute the following command. Let's dig a bit deeper to better understand what happens under the hood. Every Swift release introduces changes, features, and bug fixes. This may seem unimportant and it is less of an issue compared to the early days of Swift. Even though both Xcode 13.4.1 and Xcode 14 ship with Swift 5, the versions are different. Let's run the xcrun swift -version command one more time to illustrate the difference. sudo xcode-select -s /Applications/Xcode.app Let's switch to Xcode 13.4.1 using the xcode-select command. I usually have multiple versions of Xcode installed. xcrun swift -versionīecause I'm using Xcode 14, the output of the above command shows that Xcode 14 ships with Swift 5.7. Let's use the command line to find out what Swift version Xcode ships with. The problem is that Xcode only shows the major version or, in the case of Swift 4.2, the major and the minor version. You can switch to a different version of the Swift language using the dropdown menu. I'm using Xcode 14 so the Swift version for a new project is Swift 5. One of the build settings of the target is named Swift Language Version. Click the project in the Project Navigator and inspect the build settings of the target by selecting the Build Settings tab at the top.Įnter Swift in the search field in the top right. ![]() To figure out which version of Swift the project uses, we take a look at the build settings of the target. Using Xcodeįire up Xcode and create a project using the App template from the iOS > Application section.Ĭonfigure the project and tell Xcode where you would like to save the project files on your machine. This episode of Swift Fundamentals sheds some light on this seemingly simple question.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |