Discovering playgrounds
When Apple first introduced Swift, they created an interactive book where developers could read about the new language and actually use the language all in one document. It was built on top of a new feature in Xcode 6 called playgrounds. The idea behind the playground was that it was a good place to learn and experiment with the new language, without having to worry about setting up test projects in Xcode.
Throughout this chapter, we're going to be using playgrounds as we learn about and play with Swift. However, always try to keep them in mind, since they can be an invaluable tool for rapid prototyping when working on your own projects.
Setting up a playground
One of the things that makes playgrounds so powerful in Xcode is that they are not a part of a project, but are just individual files. This makes using them extremely straightforward. You don't have to worry about project settings or dependencies; you can just jump in and start playing.
To create a new playground...