Explore apps in Swift Playgrounds on Mac
In the Swift Playgrounds app in macOS 12.4 or later, you can explore the sample apps in the App Gallery and Extend Your App sections of the More Playgrounds screen. Double-click an app project to open it. The code appears on the left, and the code results automatically appear in the App Preview on the right.
You can share your app projects with friends and submit your app projects to the Mac App Store. See Share a playground or app project.
You can also open your app projects in Xcode, an app for taking your projects further. You can download Xcode free from the Mac App Store.
Walk through app code
You can explore SwiftUI by walking through the code in the sample apps in Swift Playgrounds. The apps come with a built-in guide, which includes walkthroughs that show the code and explain how it works.
On the More Playgrounds screen in the Swift Playgrounds app on your Mac, click a sample app in the App Gallery to open it.
To go to the More Playgrounds screen, choose Window > My Playgrounds, then click See All near the bottom right.
Click at the top right to open the guide in the sidebar on the right.
Click Start Walkthrough.
One or more lines of code become highlighted in the coding area, and an instruction panel appears above the code, explaining the highlighted code. The result of the highlighted code appears in the App Preview.
You can click a Learn More button (if it’s available) or scroll through and read the instructions by clicking Next and .
View the files in an app project
An app project—including the app projects in the App Gallery—can include Swift files, images, Swift packages, and more.
To see the files in an app project, click at the top left to open the sidebar. The Swift files, images, and other items in the app project appear there in a list.
The Swift files in the sidebar (indicated by ) contain code. To see the code in a Swift file, click the file in the left sidebar. The file opens in a separate tab. You can have multiple files open at the same time and can switch between open files by clicking the tabs.