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

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!":
主站蜘蛛池模板: 河曲县| 岳西县| 江门市| 禄劝| 东乌珠穆沁旗| 田东县| 益阳市| 钟山县| 逊克县| 七台河市| 大荔县| 叙永县| 宜兴市| 莫力| 浦江县| 久治县| 丹巴县| 沙河市| 三台县| 航空| 江口县| 绥棱县| 郴州市| 松潘县| 双城市| 筠连县| 长治市| 峡江县| 尚义县| 阳原县| 综艺| 文水县| 张家口市| 邹城市| 仁怀市| 都匀市| 雷州市| 武定县| 隆林| 吉木萨尔县| 阿尔山市|