Last active
June 5, 2019 18:33
-
-
Save ahmetws/5fe7486580a36dcc2ff71bee18a3ef52 to your computer and use it in GitHub Desktop.
How to use SwiftUI inside 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
struct Objcio: View { | |
var book: String | |
var body: some View { | |
Text(book) | |
} | |
} | |
var objcio = Objcio(book: "Advanced Swift") | |
objcio.book = "App Architecture" |
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 |
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
let liveView = UIHostingController(rootView: objcio) | |
PlaygroundPage.current.liveView = liveView |
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 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