Download our Swift Language Playground here. Playgrounds are interactive coding environments that can contain instructions. You can think of it as a textbook you can code in!

Go through the playground and you'll get a great introduction to a bunch of programming concepts in Swift, including:

  1. var vs. let
  2. Types
  3. Strings
  4. Optionals
  5. Arrays
  6. Dictionaries
  7. Tuples
  8. Control flow
  9. Functions
  10. Classes and structs
  11. Initializers
  12. Type (static) properties
  13. Protocols

Once you have the Playground opened, go through the material below before you get started.

About Playgrounds

Before you get started, there are a few things you should know about Swift Playgrounds.

What are Playgrounds?

Playgrounds are interactive coding environments that can contain instructions. The code you write gets run every time you make a change and visual output is displayed on the right. This makes it a great way to learn how to code!

Playground interface

Playground interface

There are two main areas you need to worry about in the intro track playgrounds: navigation and the instructional & coding area.


You can use this are to navigate directly to another page. The instructional and coding area also has next and previous page buttons at the bottom. If you do not see the navigation area, it can be opened with the button marked 1 in the above screenshot.

Instructional & coding area

This is where you'll be doing most of your work. This area allows for nicely formatted instructions and areas to code! Any areas that have line numbers next to them can be used for coding.

Setting up Xcode

There are two things we need to do to make our Xcode and Playground experience better. You should do this as soon as you start your first playground, it only needs to be done once!

Turning on line numbers

  1. Go to Xcode > Preferences in the menu bar. Preferences
  2. Click Text Editing in the popup. Check the box next to Line Numbers. Line numbers

Creating a keyboard shortcut

  1. Click Key Bindings (it's next to Text Editing).
  2. Enter execute in the search bar.
  3. Double-click the white space next to Execute Playgrounds.
  4. Press and hold the option key then press r.
  5. Click in the whitespace below.
  6. Verify the shortcut was added by watching this gif. The shortcut you added should match the gif.

Add shortcut

Running code in Playgrounds

By default, Playgrounds will run the code every-time you stop typing. The visualization will restart and be updated with your new code!

Re-running your code manually

If this does not seem to be working, you can re-run it by toggling the play/stop button at the bottom-left of your instructional & coding area. Toggle play

Slower computers

The auto-run feature might not work well on slower computers. You can turn it off by clicking and holding on the play/stop button then selecting Manually Run. Turn to manual

Now you can run your code when you are ready! By following the steps above or holding the option key and pressing r (this will only work if you setup the keyboard shortcut above).

My code is not working!

Playgrounds use a few different symbols to notify you when you have inputed code that will not work. Don't worry too much about the code in these examples, focus on the symbols presented.

It's good to understand what Xcode is trying to tell. Sometimes the message presented will be enough to help you fix it on your own. Other times it will be cryptic and you'll need to ask another student or instructor for help -- it is okay to ask for help!



Errors are a red octagon with a ! inside. Click them to read the message. You must fix the error for your code to finish running!

Error with suggestion

Error with suggestion

Errors with suggestions have a white circle inside instead of an !. When you double-click them, they pop up a Fix-it suggestion. You can double-click the suggestion and Xcode will try to automatically fix the problem. You must fix the error for your code to finish running!



Warnings do not stop your code from running. They are represented by a yellow triangle. Just like errors, they might have Fix-it suggestions.

Another thing to note in this example is some warnings and errors will have multiple messages associated with them. See how we click the grey 2 in the example to view both messages?

An important note

There is a ton of material in these playgrounds. We do not expect you to memorize it all! Go through each page and complete each challenge. We'll have time for group sessions to clear up any confusion and provide context for confusing concepts. If you can complete the challenges, you can move on to the next concept!

You'll have more practice with each of these concepts throughout the course. A lot of times, these concepts make more sense when you can see them in-action in the context of a real app or game! So don't worry, work through the playgrounds and be comfortable with the fact that you might not memorize everything the first time through. Read carefully, complete the challenges, and you'll do just fine!


If you have feedback on this tutorial or find any mistakes, please open issues on the GitHub Repository or comment below.

Summer academy

An iOS Development Summer Course

Design, code and launch your own app. Locations in San Francisco and Asia

Find your location

Product College

A computer science college

Graduate into a successful career as a founder or software engineer.

Learn more

Cookies on Make School's website

We have placed cookies on your device to ensure that we give you the best experience on our website.

This site uses cookies to deliver our services. By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Your use of Make School’s Products and Services is subject to these policies and terms.

Please note that Make School no longer supports Internet Explorer

We recommend upgrading to a modern web browser. Learn more