Generic Instance Method

setLiveView(_:)

Displays a view that shows the result of running the code that’s on the current page.

Declaration

func setLiveView<IncomingView>(_ newLiveView: IncomingView) where IncomingView : PlaygroundLiveViewable

Parameters

newLiveView

The view to display as the current page’s live view.

Discussion

The live view appears in the assistant editor for the current playground page. There can be only one live view open at any time.

When you call setLiveView(_:), the system sets needsIndefiniteExecution to true.

See Also

Configuring Live Views

static let current: PlaygroundPage

The current playground page.

func setLiveView<IncomingView>(IncomingView)

Displays a SwiftUI view that shows the result of running the code that’s on the current page.

var liveView: PlaygroundLiveViewable?

A live view that shows the result of running the code that’s on the current page.