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

How to do it...

With Xcode downloaded, let's create our first Swift playground:

  1. Launch Xcode from the icon in your dock.
  2. From the welcome screen, choose Get started with a playground:
  1. From the template chooser, select the blank template from the iOS tab:
  1. Choose a name for your playground and a location to save it:
Xcode Playgrounds can be based on one of the three different Apple platforms: iOS, tvOS, and macOS (the operating system formerly known as OSX). Playgrounds provide full access to the frameworks available to either iOS, tvOS, or macOS, depending on which you choose. An iOS playground will be assumed for the entirety of this book, chiefly because this is the platform of choice of the author. Where recipes do have UI components, the iOS platform will be used until stated otherwise.
  1. You are now presented with a view that looks like this:
  1. Let's replace the word playground with Swift!.
  2. Click on the blue play icon in the bottom left-hand corner of the window to execute the code in the playground:
  1. Congratulations! You have just run some Swift code.
  1. On the right-hand side of the window, you will see the output of each line of code in the playground. We can see that our line of code has output "Hello, Swift!":
主站蜘蛛池模板: 金阳县| 襄垣县| 阿鲁科尔沁旗| 象山县| 平和县| 东源县| 柳州市| 玉山县| 四子王旗| 香河县| 黎平县| 汕头市| 日土县| 新田县| 右玉县| 贺州市| 嵊泗县| 灯塔市| 天柱县| 左云县| 大埔县| 乾安县| 鲁甸县| 浙江省| 宝坻区| 赤城县| 安乡县| 米脂县| 句容市| 宁乡县| 琼海市| 柳林县| 本溪| 杭锦后旗| 平潭县| 乌拉特前旗| 如皋市| 林西县| 拜城县| 九龙城区| 射阳县|