Enter code in an app in Swift Playgrounds on iPad
You can enter or edit code in an app project by tapping in the coding area and typing. As you type, suggestions for completing your code appear. To accept a suggestion, tap it.
You can also add Swift files, Swift packages, and more in your app projects. To see these items in an app project, tap at the top left. See Add Swift files, images, and more to an app.
You can add SwiftUI controls, symbols, colors, and more from the library by tapping 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 iPad, open an app project you created, or open a sample app from the App Gallery on the More Playgrounds screen.
Tap 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 tapping them.
To turn off the line numbers to the left of your code, tap , then choose Hide Line Numbers.
(Line numbers appear in the coding area by default.)
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 sidebar (if it’s not already open) by tapping at the top left.
In the search field at the top of the sidebar, enter the text you want to find, then tap the Search key on the keyboard (or press Return).