Learn to code in Swift Playgrounds on Mac
If you don’t know how to code, you can start with the playgrounds in the Learn to Code section, which are designed to help you learn the basics of coding and prepare you to create programs of your own.
Note: If you have macOS 12.4 or later, you can create and use app projects in Swift Playgrounds. If you have macOS 11.7–12.3, you can create and use playgrounds, but you can’t create and use apps.
In the Swift Playgrounds app on your Mac, go to the More Playgrounds screen.
If you’re in the My Playgrounds window, click See All near the bottom right.
If you’re working in a playground, choose Window > My Playgrounds, then click See All near the bottom right.
Click a playground in the Learn to Code section to view a description.
Click to return to the Learn to Code section, then click Get to download the playground to your Mac.
Double-click the playground to open it.
Each Learn to Code playground begins with an introduction that teaches a coding concept. Click at the bottom of the window to page through the introduction. When you’re ready to try adding your own code, click Start Coding at the end of the introduction.
Many playgrounds are made up of pages organized into chapters. To see the chapters and pages in a playground, click to open the sidebar. (Clicking it again closes the sidebar.) To learn about a coding concept, click the Introduction page in the chapter about that concept.