There are two ways to do it. By the way, in your Xcode project next to your code, there should be a live preview. If it doesn't show, just click on the button to resume live updates.
Way 1:
import SwiftUI
struct ContentView: View {
var body: some View {
// Place the content of your view here.
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Way 2:
import SwiftUI
import PlaygroundSupport
struct ContentView: View {
var body: some View {
// Place the content of your view here.
}
}
PlaygroundPage.current.setLiveView(ContentView())
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: