---
title: PlaygroundPage
framework: playgroundsupport
role: symbol
role_heading: Class
path: playgroundsupport/playgroundpage
---

# PlaygroundPage

An object you use to configure the state of a playground page and its live view.

## Declaration

```swift
final class PlaygroundPage
```

## Overview

Overview You access the current playground page by using this class's static current property; no more than one page is ever active at the same time. Playground pages in Swift Playgrounds have different capabilities than playground pages in Xcode. For example, control over the execution mode is available only in Swift Playgrounds, while the Touch Bar is accessible only to playgrounds in Xcode.  Both playground environments can set a live view, which you use to show the visual results of running the code on the playground page. PlaygroundPage.current.setLiveView(     List(0..<42) { number in         Text("My favorite number is \(number).")     } ) You also use the current page to configure the always-on live view, a special live view that runs in a separate process from the code on a playground page and is available only in Swift Playgrounds. The always-on live view can display results that persist across multiple runs of the code on a page, or that you need for one-time setup tasks that take time to run. For example, you might use the always-on live view to display multiple stages of progress through a playground page that has multiple steps to reach the solution.  Because the always-on live view is hosted outside of the process that runs the code on a playground page, you communicate with it indirectly. For more information, see Messaging Between a Playground Page and the Always-On Live View.

## Topics

### Configuring Live Views

- [current](playgroundsupport/playgroundpage/1964509-current.md)
- [setLiveView(_:)](playgroundsupport/playgroundpage/3375751-setliveview.md)
- [setLiveView(_:)](playgroundsupport/playgroundpage/3375752-setliveview.md)
- [liveView](playgroundsupport/playgroundpage/1964506-liveview.md)

### Configuring Execution

- [executionMode](playgroundsupport/playgroundpage/3029561-executionmode.md)
- [PlaygroundPage.ExecutionMode](playgroundsupport/playgroundpage/executionmode.md)
- [needsIndefiniteExecution](playgroundsupport/playgroundpage/1964501-needsindefiniteexecution.md)
- [finishExecution()](playgroundsupport/playgroundpage/1964505-finishexecution.md)

### Assessing Progress

- [assessmentStatus](playgroundsupport/playgroundpage/3029560-assessmentstatus.md)
- [PlaygroundPage.AssessmentStatus](playgroundsupport/playgroundpage/assessmentstatus.md)

### Inspecting Page Data

- [text](playgroundsupport/playgroundpage/3029563-text.md)
- [keyValueStore](playgroundsupport/playgroundpage/3029562-keyvaluestore.md)

### Displaying Touch Bar Items

- [liveTouchBar](playgroundsupport/playgroundpage/2919769-livetouchbar.md)

### Instance Properties

- [userModuleNames](playgroundsupport/playgroundpage/3919480-usermodulenames.md)
- [wantsFullScreenLiveView](playgroundsupport/playgroundpage/3074093-wantsfullscreenliveview.md)

### Instance Methods

- [getText(forSourceFile:inUserModule:)](playgroundsupport/playgroundpage/3919478-gettext.md)
- [listSourceFiles(inUserModule:)](playgroundsupport/playgroundpage/3919479-listsourcefiles.md)
- [navigateTo(page:)](playgroundsupport/playgroundpage/3239065-navigateto.md)
- [openApplication(withBundleIdentifier:iTunesItemIdentifier:)](playgroundsupport/playgroundpage/3239066-openapplication.md)
- [openPlayground(withContentIdentifier:toPageAtIndex:)](playgroundsupport/playgroundpage/3239067-openplayground.md)
- [showGlossaryEntry(named:at:in:)](playgroundsupport/playgroundpage/3239068-showglossaryentry.md)

### Enumerations

- [PlaygroundPage.PageNavigation](playgroundsupport/playgroundpage/pagenavigation.md)
