- 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!":

推薦閱讀
- TypeScript Essentials
- OpenCV實例精解
- PaaS程序設計
- Spring Boot進階:原理、實戰與面試題分析
- jQuery炫酷應用實例集錦
- 軟件測試實用教程
- ElasticSearch Cookbook(Second Edition)
- 零基礎學Kotlin之Android項目開發實戰
- R用戶Python學習指南:數據科學方法
- Serverless Web Applications with React and Firebase
- 后臺開發:核心技術與應用實踐
- OpenCV with Python Blueprints
- Tableau Desktop可視化高級應用
- Mastering Gephi Network Visualization
- 深度學習入門:基于Python的理論與實現