Last active
August 27, 2020 13:37
-
-
Save below/1426b05fb03a461edbad4d8f7c4a13a9 to your computer and use it in GitHub Desktop.
Why is this not working?
This file contains hidden or 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 SwiftUI | |
import PlaygroundSupport | |
struct TestView: View { | |
@State var foo = "faz" | |
init() { | |
foo = "bar" | |
debugPrint(foo) // prints "faz" | |
} | |
var body: some View { Text(foo) } | |
} | |
PlaygroundPage.current.setLiveView(TestView()) | |
// Result: faz is displayed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment