Skip to content

Instantly share code, notes, and snippets.

@Kievkao
Created November 19, 2024 15:23
Show Gist options
  • Select an option

  • Save Kievkao/70cb52720cd9bea4e1252ee805a2fa42 to your computer and use it in GitHub Desktop.

Select an option

Save Kievkao/70cb52720cd9bea4e1252ee805a2fa42 to your computer and use it in GitHub Desktop.
SwiftUI preview in Playground
import SwiftUI
import PlaygroundSupport
struct MyExperimentalView: View {
var body: some View {
Text("Hello")
}
}
let view = MyExperimentalView()
let hostingVC = UIHostingController(rootView: view)
PlaygroundPage.current.liveView = hostingVC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment