How to add auxiliary code to a playground

Each playground may need a bunch of classes which are helping to illustrate the problem or a solution. There is a handy way to add a chunk of code, which is compiled once it is added or changed. This means that those parts won't be compiled each time the playground is executed. The files containing code are called auxiliary files. To add such a file, we should do the following:

  1. Open the Navigator panel (cmd + 1).
  2. Select the Sources folder.
  3. Press the + button at the bottom of the Navigator panel.
  4. Select New File.
  5. Give the new file a nice name related to its role.
  6. Add the code which you want to reuse in the playground. Don't forget to add the public scope modifier to make it visible in your playground
  7. Try to use it in the main playground:

Playgrounds can contain different resources such as images, statistic data, sound, and so on. These are placed in the Resources folder. Here is a step-by-step guide on how to add a resource (image/asset) to a playground.