An object you use to configure the state of a playground page and its live view.
- macOS 10.12+
- Xcode 8.0+
- Swift Playgrounds 2.0+
- Playground Support
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.
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.