Setting up the environment

There are a couple of ways to run Swift 4.

It's a prerequisite that you have a developer account and then you can use either of the mentioned methods:

  • Install Xcode 9, search for Xcode 9, log in with your developer account, and download the current beta available for downloads.
  • In case you prefer to use Xcode 8, you can use the latest development snapshot for Swift 4.0 available at Swift.org. Once the download finishes, open the package .pkg file and install the snapshot. Open Xcode and go to Xcode | Toolchains | Manage Toolchains. Now pick the recently installed Swift 4.0 Snapshot and restart Xcode IDE:

Now your projects or playgrounds will use Swift 4 while compiling. We will use Xcode 9 for writing and executing all the code in this book. At the time of writing, the current Xcode 9 is in beta release version 6.

In the subsequent sections, you will read about the new features available in Swift 4, how you can transition to the latest Swift version, that is, Swift 4, and what should be the strategy for  switching a massive code base written in Swift 3 to Swift 4; however, before that, a word of caution- the language is still in beta, and we should expect some changes and bug fixes along the lines until the official release is announced. With that being said, there is nothing to worry about; to keep an eye on the changes and stay up to date with the new implementations and bug fixes, follow the official release notes.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset