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

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!":
主站蜘蛛池模板: 平武县| 庄河市| 普陀区| 遵化市| 青神县| 黎城县| 诸暨市| 岳西县| 永泰县| 田林县| 汤阴县| 合江县| 泸定县| 湄潭县| 广东省| 武宁县| 武夷山市| 江华| 丹凤县| 遂川县| 合阳县| 朔州市| 中方县| 柳河县| 博客| 陆丰市| 深水埗区| 玛多县| 惠东县| 鹿泉市| 舞阳县| 寻甸| 兴业县| 伽师县| 南澳县| 阿合奇县| 长泰县| 哈密市| 临安市| 大竹县| 河东区|