This will print the current version of being used in your current Xcode project. $ xcodebuild -showBuildSettings | grep SWIFT_VERSION ![]() We can quickly scan the build setting using the following command from the terminal. Xcode can use the different version of the Swift using the build setting $SWIFT_VERSION from the build setting tab of Xcode target if we have other Swift versions available. $ xcrun -f swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift We can check the location of the Swift binary using the following command. This will print the existing version of Swift being used by recent Xcode version. We can check the Swift version just running following command. Its also important to check which Swift version being used at the moment of time. e.g for beta versions we can switch to beta Xcode using $ sudo xcode-select - switch /Applications/Xcode-beta.app/ $ export TOOLCHAINS=swift However, if we have multiple Xcode versions installed we can switch the Xcode developer directory using xcode-select utility. Xcode developer directory for the located at /Applications/Xcode.app/Contents/Developer/ by default. We can always find the version of Swift with Xcode in the release notes. The new release of Xcode always has a latest stable version of Swift e.g Xcode 9.3 shipped with Swift 4.1. Xcode and Swiftīefore jumping into changing Swift versions, let’s talk about how the Xcode and Swift version are related to each other. In this post, we will see how we can switch between multiple Swift version without changing Xcode versions. Apple ship new Xcode version with the newest version of Swift all the all the time, it often requires iOS developers to switch the Xcode versions or keep multiple version of Xcode at the same time. ![]() Swift is evolving day by day but we have to make sure our apps or libraries still work with constantly changing Swift. ![]() However, since Apple has open-sourced Swift, it is going through major breaking changes. There is no doubt that Swift is amazing programming language to develop iOS apps.
0 Comments
Leave a Reply. |