Run your app in Swift Playgrounds on Mac
In a SwiftUI app created in Swift Playgrounds, you don’t have to run the code to see what it does—the result of the code appears automatically in the App Preview on the right. If you make changes to the code, the App Preview is automatically updated to reflect your code changes.
Run your app
You can run (or rerun) an app explicitly by clicking above the coding area.
To stop an app that’s running, click above the coding area.
If your code won’t run
Sometimes typos and other hard-to-spot bugs get introduced into code. These errors can cause your app or your App Preview to crash. If this happens, an inline error icon appears in your code, next to the line where the error occurred. You can click the icon for more detail on the reason for the error. The App Preview shows a Backtrace—the hierarchy of function and method calls that resulted in the crash.
If you see in the toolbar, it indicates there are issues in your code that aren’t preventing the app from building.
If appears in the toolbar, it indicates there are issues that are preventing the app from building and running.
You can click either of these icons to see a list of the issues in each Swift file in your app project.