How can i run App on ipad playground for swift
var body: some Scene {
WindowGroup {
TabView {
Text("one")
Text("tow")
}
}
}
}
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())