Use and create playgrounds in Swift Playgrounds on iPad
In addition to working with app projects, you can use and create playgrounds in Swift Playgrounds. To explore sample playgrounds, go to the More Playgrounds screen—the playgrounds are in the Books section at the bottom of the screen.
In the Swift Playgrounds app on your iPad, tap a playground in the Books section at the bottom of the More Playgrounds screen to view a description.
To go to the More Playgrounds screen, tap See All near the bottom right of the My Playgrounds screen.
If you’re working in a playground, tap at the top left, then tap See All.
Tap to return to the More Playgrounds screen, then tap Get to download the playground.
After it’s downloaded, tap the playground to open it.
If there’s code in the playground, you can tap Run My Code to see what it does.
If the playground begins with an Introduction, tap at the bottom of the screen to page through the Introduction, then tap Start Coding at the end of the introduction.
The playgrounds have sample code you can run. To step through the code and see it become highlighted as it runs, tap , then choose Step Through My Code.
To create a new playground, go to the My Playgrounds screen and tap the Playground button near the bottom left.
When you’re ready to add your own code, see Enter code in a playground. You can apply what you learned in the Learn to Code playgrounds and other playgrounds where you tried running code.
You can also explore the code in any preexisting shared Swift files that come with the template. See Work with shared files.