Testing the Swift New Features

Kumar Reddy
Geek Culture
Published in
3 min readJun 7, 2021

--

Image source: undraw.co

As Swift becomes more popular with the open-source contributions/evolutions, you will see a lot of proposals and new features getting added to the Swift library.

As a developer, we are fascinated about the new features and also at the same time wanted to try out the features with some examples to get more understanding of the proposals/features.

Trying out the Swift new features is not difficult, it is just a matter of following few steps and here I am trying to put it down in an article. It will help out developers to focus on the new features instead of trying to set up the environment.

Before we jump on to the steps, let’s first understand the Toolchain. In software, the toolchain refers to

a toolchain is a set of programming tools that is used to perform a complex software development task or to create a software product, which is typically another computer program or a set of related programs. Refer here more details

In our Swift environment,

The toolchain is a collection of the compiler(swiftc), lldb, llvm, and other related tools(swift-demangle, swift-driver, swift-build-tool, etc) needed to provide a development experience to work with a specific version of Swift.

Let's get into the steps to set up the swift development environment. Please follow the below steps

  1. Download the latest swift toolchain from here. Choose the platform and download the package.
  2. For Mac OS, Install the package on the platform. For other platforms, please read the more detailed guide here.

3. Once the package is installed, you will a new toolchain got added to the Xcode Components.

Alternatively, you can also access the same from Xcode -> Preferences -> Components -> Select Toolchain tab

4. Please uncheck the Debug Executable from the scheme → Run section

As per the documentation,

The “Debug executable” checkbox specifies whether or not you want to run with the debugger enabled. Once running, you can use Debug > Attach to Process on a process that has been launched with debugging disabled if needed.

In our case, I assume the experimental toolchains do not have the necessary Xcode tools to support the debug experience.

Once you follow the above-mentioned steps, now you can able to test the latest Swift features.

Thank you for reading the article. Please provide your valuable feedback/comments for improving the article.

--

--

Kumar Reddy
Geek Culture

Mobile Engineering Manager @ KeepTruckIn | Ex — PayPal, Swiggy | https://github.com/BKRApps.