Playground Page Manifest
The Manifest.plist
file for a playground page contains the following key-value pairs specifying the attributes for a page:
User-viewable name for the page
Live view configuration
Playground logging configuration
Instructions for copying content between pages
The file is located at the top level of the .playgroundpage
folder for the page.
Key List
Table 5-1 describes each key for a playground page, its type, and whether the key is required.
Key |
Type |
Description |
Required |
---|---|---|---|
|
Dictionary |
Configuration for copying code between playground pages. See CodeCopySetup Key. |
|
|
Boolean |
Sets the live view to extend past the margin in the area used for live views. See LiveViewEdgeToEdge Key. |
✓ |
|
String |
Sets the live view to show even when it is not running. See LiveViewMode Key. |
✓ |
|
String |
The name displayed in the user interface. See Name Key. |
✓ |
|
String |
Controls the display of results in playground pages. See PlaygroundLoggingMode Key. |
|
|
String |
An image shown before the live view runs. See PosterReference Key. |
|
CodeCopySetup Key
A dictionary of key-value pairs that specifies instructions shown to a user when copying content between playground pages.
Table 5-2 describes each key for the CodeCopySetup
dictionary, its type, and whether the key is required.
Key |
Type |
Description |
Required |
---|---|---|---|
|
String |
The title of the button used to copy the code to the current playground page. See CopyCommandButtonTitle Key. |
|
|
String |
The title of the button used to copy the default code to the current playground page. See DefaultCommandButtonTitle Key. |
|
|
String |
The title of the button used to navigate back to the playground page from which the code is copied. See NavigateCommandButtonTitle Key. |
|
|
String |
The instructions displayed when code isn’t ready to be copied to the current playground page, such as when a previous page has not been completed. See NotReadyToCopyInstructions Key. |
✓ |
|
String |
The instructions displayed when code is ready to be copied to the current playground page. See ReadyToCopyInstructions Key. |
✓ |
CopyCommandButtonTitle Key
The title for the copy command button.
If no value is specified, this defaults to “Copy my code”.
DefaultCommandButtonTitle Key
The title for the default command button.
If no value is specified, this defaults to “Start with provided code”.
NavigateCommandButtonTitle Key
The title for the navigate command button.
If no value is specified, this defaults to “Go to <PREVIOUS_PAGE>
”, where <PREVIOUS_PAGE>
is substituted for the name of the previous page.
NotReadyToCopyInstructions Key
The text to show when the code isn’t ready to be copied to the current page.
ReadyToCopyInstructions Key
The text to show when the code is ready to be copied to the current page.
LiveViewEdgeToEdge Key
A Boolean controlling the initial size of the live view. Setting the key to true
expands the live view to fill the live view area, which includes the Run button and the Hints button. These buttons overlay the live view.
Figure 5-1 shows how the value of LiveViewEdgeToEdge
changes the size of the live view. The playground page on the left side of the figure uses a value of NO
false
. The page on the right side of the figure uses a value of YES
true
.
LiveViewEdgeToEdge
key value

LiveViewMode Key
Used to control the display of the live view area while the live view is not running.
The possible values for LiveViewMode
are:
VisibleByDefault
. Shows the live view when the playground opens.HiddenByDefault
. Hides the live view until the playground is run.
Figure 5-2 shows how the value of LiveViewMode
affects the initial display of a live view area. The playground page on the left side of the figure uses a value of VisibleByDefault
. The page on the right side of the figure uses a value of HiddenByDefault
.

Name Key
The display name of the playground page in the user interface; for example, the name of a page in the table of contents.
The name is also used as part of the link to the first use of a glossary term. (See PageReference Key in Glossary Property List.)
In Figure 5-3, Example Page
is the name of the playground page in the table of contents.

PlaygroundLoggingMode Key
Controls the display of results for executed playground statements.
The possible values for PlaygroundLoggingMode
are:
Off
. Playground logging is off and no results are displayed.Normal
. (Default value) Playground logging is on and results are displayed.
Figure 5-4 shows a playground with results for each of the executed statements. The user can tap the result to view the value, and then can add an inline result viewer. Turning off logging can speed up execution of playgrounds.

PosterReference Key
The base name of an image file that is shown centered and unscaled in the live view area before the live view runs. The image file can be in any Resources
folder in the book. The book package can contain multiple resolutions of the same image. For more information on multiple resolutions, see Loading Image Resources in Resource Programming Guide.
Use PosterReference Key
to show a small image such as a logo, or a large image that works for multiple screen sizes because the live view area can be resized.
In Figure 5-5, Llama logo.png
is used to show a Llama in the center of the live view area of the playground page.

Copyright © 2018 Apple Inc. All rights reserved. Terms of Use | Privacy Policy | Updated: 2018-01-24