Playground Support

Leverage supporting functionality in Xcode to interact with a playground. Share playground data, manage live views, and control the execution of a playground.


The Playground Support module provides behavior to help you take advantage of playgrounds. Use this module to:

  • Access a playground page and manage its execution

  • Display and dismiss live views

  • Share and access persistent data

To use this module in a playground, import the module as follows:

Listing 1

import PlaygroundSupport



class PlaygroundPage

An object that represents the state of a playground page and enables you to interact with Xcode.


protocol PlaygroundLiveViewable

A protocol for types that can be displayed as the live view for a playground.


enum PlaygroundLiveViewRepresentation

An enumeration describing the supported representations for live views in playgrounds.