Skip to content

Instantly share code, notes, and snippets.

@ahmetws
Last active June 5, 2019 18:33
Show Gist options
  • Save ahmetws/5fe7486580a36dcc2ff71bee18a3ef52 to your computer and use it in GitHub Desktop.
Save ahmetws/5fe7486580a36dcc2ff71bee18a3ef52 to your computer and use it in GitHub Desktop.
How to use SwiftUI inside Playground
struct Objcio: View {
var book: String
var body: some View {
Text(book)
}
}
var objcio = Objcio(book: "Advanced Swift")
objcio.book = "App Architecture"
import PlaygroundSupport
import SwiftUI
let liveView = UIHostingController(rootView: objcio)
PlaygroundPage.current.liveView = liveView
import PlaygroundSupport
import SwiftUI
struct Objcio: View {
var book: String
var body: some View {
Text(book)
}
}
var objcio = Objcio(book: "Advanced Swift")
objcio.book = "App Architecture"
let liveView = UIHostingController(rootView: objcio)
PlaygroundPage.current.liveView = liveView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment