官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 杨浦区| 金秀| 濮阳市| 清苑县| 桃源县| 临夏县| 仙游县| 普陀区| 安陆市| 塔城市| 清丰县| 鲁山县| 钟祥市| 会东县| 彰武县| 阜城县| 松阳县| 绥宁县| 镇坪县| 江西省| 宁海县| 乌拉特中旗| 张掖市| 肃北| 锦州市| 海林市| 扎鲁特旗| 兴和县| 新宁县| 莫力| 九龙坡区| 孙吴县| 龙胜| 湖南省| 木里| 四会市| 任丘市| 涞源县| 海宁市| 南丹县| 柯坪县|