Running Your Code

A playground is a place for you to write and experiment with Swift code on your terms. You get to choose when the code you write will actually be run by Xcode. By default, a new playground will only execute code when you tell it to.

Notice the small play button () in the lefthand gutter next to your code (Figure 1.4, “Your new playground”). This symbol means that the playground is currently paused at this line and has not executed it. If you move your cursor up and down the gutter (without clicking), the button will follow you. Clicking the play button next to any line in the playground will execute all the code up to that line. ...

Get Swift Programming: The Big Nerd Ranch Guide, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.