- Swift 4 Programming Cookbook
- Keith Moon
- 215字
- 2021-07-08 10:21:20
How to do it...
With Xcode downloaded, let's create our first Swift playground:
- Launch Xcode from the icon in your dock.
- From the welcome screen, choose Get started with a playground:

- From the template chooser, select the blank template from the iOS tab:

- 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.
- You are now presented with a view that looks like this:

- Let's replace the word playground with Swift!.
- Click on the blue play icon in the bottom left-hand corner of the window to execute the code in the playground:

- Congratulations! You have just run some Swift code.
- 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!":

推薦閱讀
- 程序員面試筆試寶典
- MATLAB圖像處理超級學習手冊
- Ext JS Data-driven Application Design
- Designing Hyper-V Solutions
- Apache Spark 2.x for Java Developers
- PHP編程基礎與實踐教程
- SignalR:Real-time Application Development(Second Edition)
- jQuery從入門到精通(微課精編版)
- LabVIEW數據采集
- 超好玩的Scratch 3.5少兒編程
- 實戰Python網絡爬蟲
- Java Web開發教程:基于Struts2+Hibernate+Spring
- Google Adsense優化實戰
- 計算機應用基礎
- JSP程序設計與案例教程