Playing in a Playground
As you can see in Figure 1.4, a Swift playground opens with two sections. On the left, you have the Swift code editor. On the right, you have the results sidebar. The code in the editor is evaluated and run, if possible, every time the source changes. The results of the code are displayed in the results sidebar.
Figure 1.4 Your new playground
Let’s take a look at your new playground.
Notice that the first line of text is green and that it begins with two forward slashes: //.
The slashes signify to the compiler that the line is a comment, and Xcode shows comments in green.
Developers use comments ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access