Explore apps in Swift Playgrounds on iPad
In Swift Playgrounds in iPadOS 15.2 or later, you can explore the sample apps in the App Gallery and in the Extend Your App section of the More Playgrounds page. Tap 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.
App projects you create can be used in Swift Playgrounds. You can share your app projects with friends and submit your apps to the App Store. See Share a playground or app project on iPad.
You can also open your app projects in Xcode, which includes useful coding features to help you take your projects further.
Walk through app code
You can begin learning SwiftUI by walking through the code in the sample apps in Swift Playgrounds. The apps come with a built-in guide, “Building Your First App.” The guide includes walkthroughs that show the code and explain how it works.
On the More Playgrounds screen in the Swift Playgrounds app on your iPad, tap a sample app in the App Gallery to open it.
Tap at the top right to open the guide in the sidebar on the right.
Tap Start Walkthrough or another button in the guide on the right.
A line of code becomes highlighted in the coding area, and an instruction panel appears above the line, explaining the highlighted code. The result of the highlighted code appears in the App Preview.
You can tap a Learn More button (if one appears) or scroll through and read the instructions by tapping Next and .
View the resources in an app project
An app project can include Swift files, images, Swift packages, and other assets. Most of the app projects in the App Gallery have such resources.
To see the resources in an app project, tap at the top left to open the sidebar. The resources in the project appear in a list in the left sidebar.
The Swift files in the sidebar (indicated by ) contain code. To see the code in a Swift file, tap it 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 tapping the tabs