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

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.

主站蜘蛛池模板: 射阳县| 绥江县| 杨浦区| 富平县| 越西县| 平远县| 永顺县| 余江县| 衡阳县| 昆山市| 灵丘县| 江川县| 沛县| 新丰县| 蓬莱市| 洛扎县| 长治县| 宁陵县| 思南县| 防城港市| 同仁县| 古浪县| 潮安县| 察哈| 平定县| 双鸭山市| 确山县| 韶关市| 张家界市| 上虞市| 赤壁市| 正安县| 葵青区| 墨竹工卡县| 桂平市| 德格县| 金湖县| 乃东县| 屯昌县| 三河市| 苍溪县|