---
title: "setLiveView(_:)"
framework: playgroundsupport
role: symbol
role_heading: Generic Instance Method
path: playgroundsupport/playgroundpage/3375751-setliveview
---

# setLiveView(_:)

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

## Declaration

```swift
final func setLiveView<IncomingView>(_ newLiveView: IncomingView) where IncomingView : View
```

```swift
func setLiveView<IncomingView>(_ newLiveView: IncomingView) where IncomingView : View
```

## Parameters

- `newLiveView`: The view to display as the current page’s live view.

## Discussion

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

- [current](playgroundsupport/playgroundpage/1964509-current.md)
- [setLiveView(_:)](playgroundsupport/playgroundpage/3375752-setliveview.md)
- [liveView](playgroundsupport/playgroundpage/1964506-liveview.md)
