Enter code in an app in Swift Playgrounds on Mac
You can enter or edit code in an app project by clicking in the coding area and typing. As you type, suggestions for completing your code appear. To accept a suggestion, press Return.
You can also add code by inserting (Swift files, Swift packages, images, and more) in the left sidebar. To see the items in the left sidebar, click at the top left. See Add Swift files, images, and more to an app project.
You can add SwiftUI controls, symbols, colors, and more, from the library by clicking near the top right of the coding area.
Enter code
In an app project you create, or in a sample app from the App Gallery, you can enter code.
In the Swift Playgrounds app on your Mac, open an app project you created, or open a sample app from the App Gallery on the More Playgrounds screen.
To go to the More Playgrounds screen, choose Window > My Playgrounds, then click See All near the bottom right.
Click in the app’s coding area and start typing.
Note: If you don’t want to change existing code, you can add a Swift file and enter code in it.
If code completion suggestions appear as you type, you can accept them by pressing Return.
Search across your project files
While you’re entering code, you can search for text across all the files in your project to find places where you might want to make changes.
In the app project you’re creating, open the left sidebar (if it’s not already open) by clicking at the top left.
In the search field at the top of the left sidebar, enter the text you want to find, then press Return.