Framework

PlaygroundSupport

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

Overview

The PlaygroundSupport 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

Symbols

Classes

PlaygroundPage

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

Protocols

PlaygroundLiveViewable

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

Enumerations

PlaygroundLiveViewRepresentation

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

Extended Types

NSView

An NSView object provides the infrastructure for drawing, printing, and handling events in an app. You typically don’t use NSView objects directly. Instead, you use objects whose classes descend from NSView or you subclass NSView yourself and override its methods to implement the behavior you need. An instance of the NSView class (or one of its subclasses) is commonly known as a view object, or simply as a view.

NSViewController

A view controller manages a view, typically loaded from a nib file.