Getting started with Playgrounds

Playgrounds are interactive work environments that let us write code and see the results immediately as changes are made to the code. This means that Playgrounds are a great way to learn and experiment with Swift. Now that we can use Swift Playgrounds on the iPad, we do not even need to have a computer in front of us to experiment with Swift.

If you are using Swift on the Linux platform you will not have Playgrounds available, but you can use the REPL (Read-Evaluate-Print-Loop) shell to experiment with Swift without compiling your code. If you are using Swift on something other than a macOS computer or an iPad, you can safely skip this section.

Playgrounds also make it incredibly easy to try out new APIs, ...

Get Mastering Swift 4 - Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.