- Learn Swift by Building Applications
- Emil Atanasov
- 213字
- 2021-06-25 22:13:50
What is a playground?
Straight from the file generated by Xcode:
"Playground – noun: a place where people can play."
Playground is a simple project, which can be used to practice, experiment, prototype and play with code and the underlying OS. It's easy to write some code to sketch an idea or to clarify a concept. The best thing is that you can mix text (markup) with code. Also, it's possible to use the native functions that are specific for the platform (for example iOS). This makes playground projects very expressive and realistic.
Let's create a playground and pe deeper into it:
- Open Xcode
- Select File | New | Playground or simply press "Option + cmd + Shift + N"
- Pick a nice name—for example Swift 4 by examples
- Set the platform to iOS
- Click Next
- Select a place to save the file
- Press Create
As a result of these steps, you will have a new playground, which will only have a few rows.
The playground can contain more than one page.
In our example, we are using just a single-page playground, but if you want to express something complex, you can add another page using the + button in the Navigator panel (at the very bottom).
- Implementing VMware Horizon 7(Second Edition)
- Java程序設計(慕課版)
- C#程序設計實訓指導書
- LabVIEW入門與實戰開發100例
- Instant Zepto.js
- OpenCV for Secret Agents
- Web開發的貴族:ASP.NET 3.5+SQL Server 2008
- SQL Server 2016數據庫應用與開發習題解答與上機指導
- Python:Master the Art of Design Patterns
- Python編程從0到1(視頻教學版)
- 零代碼實戰:企業級應用搭建與案例詳解
- Python物理建模初學者指南(第2版)
- Java高手是怎樣煉成的:原理、方法與實踐
- Parallel Programming with Python
- Java Script從入門到精通(第5版)