<!--
{
  "documentType" : "article",
  "framework" : "Swift Playgrounds",
  "identifier" : "/documentation/Swift-Playgrounds/live-preview",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Previewing SwiftUI views in Swift Playgrounds"
}
-->

# Previewing SwiftUI views in Swift Playgrounds

Use the canvas in Swift Playgrounds to see a live preview of the SwiftUI views in your app.

## Overview

In Swift Playgrounds, you can see live Previews of your SwiftUI views just like [Previews in Xcode](https://developer.apple.com/documentation/swiftui/previews-in-xcode). In an app playground, you have a default App Preview that generates from the structure that conforms to the [App](https://developer.apple.com/documentation/swiftui/app) protocol. The canvas on the right hand side updates its title to “App Preview” when the App Preview renders.

![A screenshot of Swift Playgrounds that shows the Date Planner app playground with the DatePlannerApp file open in the editor and its App Preview displayed in the Previews canvas.](images/com.apple.Swift-Playgrounds/app-previews-in-playgrounds@2x.png)

To see live Previews, use a structure that conforms to the [PreviewProvider](https://developer.apple.com/documentation/swiftui/previewprovider) protocol. When you create a SwiftUI view in code, the canvas displays an interactive Preview. The Preview renders live updates when you make changes to its associated file. Making small edits in a file, like changing a property value or string literal changes, causes the Preview to update instantly, while making bigger changes, like adding a new type or changing types, causes the Preview to refresh. When a Preview is available for a specific SwiftUI view, you can see that the canvas displays a page control under the current Previews. This page control allows you to switch between the App Preview and any view previews in the current file. The canvas updates its title to “Preview” when a view preview renders.

![A screenshot of Swift Playgrounds that shows the Date Planner app playground with the EventDetail file open in the editor and its live Preview displayed in the Preview canvas.](images/com.apple.Swift-Playgrounds/previews-in-playgrounds@2x.png)

You can run your app within Swift Playgrounds. When you tap Run, Swift Playgrounds builds and displays your app so you can see what your app looks like and test its functionality. While running the app, you interact with Playgrounds App window by tapping the Swift icon in the status bar. This opens a menu with the following options:

![A screenshot of Swift Playgrounds that shows pop up of Playground’s App window with its available options while the Date Planner app runs in the App window’s background.](images/com.apple.Swift-Playgrounds/playgrounds-app-window@2x.png)

- Restart – Restarts your app and creates a new instance.
- Stop – Stops the current running instance of your app.
- Show Project – Go back to your app playground files to look at code while your app is running.
- Show Console – See any live print statements that you may have in your code.
- Delete App Data and Restart – Deletes any cached app data and restarts your app.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)