How can i run App and Scene on ipad SwiftUI playground

How can i run App on ipad playground for swift


    var body: some Scene {

        WindowGroup {

            TabView {

                Text("one")

                Text("tow")

            }

        }

    }

}

Answered by OOPer in 693846022

In your code (when you show your code, please show all the code as text), Welcoming is an App, not a View.

To use setLiveView, the target needs to be a View.

And there's no support showing App or Scene as live in PlaygroundPage of the current (3.4.1) Swift Playgrounds.

(Swift Playgrounds 4 is expected to come late this year.)

You may need to create a view to use setLiveView.

struct ContentView: View {
    var body: some View {
        TabView {
            Text("one")
            Text("tow")
        }
    }
}

PlaygroundPage.current.setLiveView(ContentView())
Accepted Answer

In your code (when you show your code, please show all the code as text), Welcoming is an App, not a View.

To use setLiveView, the target needs to be a View.

And there's no support showing App or Scene as live in PlaygroundPage of the current (3.4.1) Swift Playgrounds.

(Swift Playgrounds 4 is expected to come late this year.)

You may need to create a view to use setLiveView.

struct ContentView: View {
    var body: some View {
        TabView {
            Text("one")
            Text("tow")
        }
    }
}

PlaygroundPage.current.setLiveView(ContentView())
How can i run App and Scene on ipad SwiftUI playground
 
 
Q