Last active
October 28, 2021 09:10
-
-
Save ykws/18a2cbdb70ed297c6df09c9548547e80 to your computer and use it in GitHub Desktop.
Run SwiftUI on Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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