Add Swift files, images, and more to an app playground in Swift Playgrounds on Mac
In an app playground, you can add Swift files, images, Swift packages, and more to enrich the experience of your app.
In an open app playground in Swift Playgrounds on your Mac, click at the top left to open the left sidebar.
Add any of the following:
Swift file: To add a file that you can enter code in, choose File > New Source File. You can add code to your new Swift file by clicking to open it, then typing in its coding area.
Folder: To add a folder for organizing your files, choose File > New Folder.
Image: To add a photo or other image, choose File > Add File. Locate the image file, then click Open.
Swift package: To add a Swift package—a reusable component of code bundled with source files and other assets in a way that’s easy to use in your app playground—choose File > Add Package. A Swift package can be shared across projects for various purposes.