Skip to content

Instantly share code, notes, and snippets.

@ykws
Last active October 28, 2021 09:10
Show Gist options
  • Save ykws/18a2cbdb70ed297c6df09c9548547e80 to your computer and use it in GitHub Desktop.
Save ykws/18a2cbdb70ed297c6df09c9548547e80 to your computer and use it in GitHub Desktop.
Run SwiftUI on Playground
import PlaygroundSupport
import SwiftUI
struct Home: View {
var body: some View {
Text("Hello, world!")
}
}
let viewController = UIHostingController(rootView: Home())
let navigationController = UINavigationController(rootViewController: viewController)
PlaygroundPage.current.liveView = navigationController
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment