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

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!":
主站蜘蛛池模板: 桃园县| 虎林市| 嘉定区| 济源市| 西贡区| 兴山县| 黄大仙区| 个旧市| 成安县| 沭阳县| 嘉善县| 郑州市| 桑植县| 革吉县| 泊头市| 梨树县| 新巴尔虎左旗| 沅江市| 平昌县| 天等县| 临颍县| 婺源县| 濮阳县| 贵港市| 颍上县| 海淀区| 喀什市| 马关县| 福建省| 桐庐县| 改则县| 峡江县| 海淀区| 荣成市| 灌云县| 子长县| 军事| 浪卡子县| 马尔康县| 建宁县| 岳西县|