Explore app playgrounds in Swift Playgrounds on Mac
In the Swift Playgrounds app , you can explore the samples in the App Gallery and Extend Your App sections of the More Playgrounds window. Double-click an app playground to open it. In any app playground, the code appears on the left, and the code results automatically appear in the App Preview on the right.
You can share your app playgrounds with friends and submit your apps to the Mac App Store. See Share a playground.
You can also open your apps in Xcode—an app for taking your apps further. You can download Xcode free from the Mac App Store.
Walk through code in app playgrounds
You can explore SwiftUI by walking through the code in the sample app playgrounds in Swift Playgrounds. They come with built-in guides, which walk through the code and explain how it works.
In the More Playgrounds window in the Swift Playgrounds app on your Mac, click Get next to one of the sample app playgrounds in the App Gallery to open it.
To go to the More Playgrounds window, 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 (if it appears) or another button, such as Start Building, in the guide on the right.
View the assets in an app playground
An app playground—including the playgrounds in the App Gallery—can include Swift files, images, Swift packages, and other assets.
To see a list of the assets in an app playground, click at the top left to open the sidebar.
Note: If you don’t see , choose View > Show Sidebar.
In the sidebar is a list of the Swift files, images, and other assets in the app playground.
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 switch between open files by clicking the tabs.
Below the Swift files are image files. You can click one to see its contents.