Reset a playground in Swift Playgrounds on Mac
In Swift Playgrounds, after you run the code in a playground, you can reset it to remove the code you added and the results of running it. This is especially useful if you want to retry a challenge you already completed. You can reset the current page or all the pages in a playground.
Reset a page in a playground
Note: Resetting a page removes the code changes you made on the page and returns the page to its original state. In a playground that supports user modules, resetting a page resets the code in the main Swift file on the current page (in the tab with at the top) but doesn’t reset the shared Swift files in the playground.
To reset a page in the Swift Playgrounds app on your Mac, go to the page you want to reset, then choose File > Reset Page.
Reset a playground
Note: Resetting a playground removes the code, pictures, and resources you’ve added and returns the playground to its original state. In a playground that supports user modules, resetting a playground removes modules and files you’ve added to the playground and the code changes you’ve made to any of the Swift files that came with the playground.
To reset a playground in the Swift Playgrounds app on your Mac, go to the Playgrounds screen by clicking at the top left.
Control-click the playground you want to reset, then choose Reset Playground.