Skip to content

Instantly share code, notes, and snippets.

@ryanwilson
Last active September 17, 2019 02:35
Show Gist options
  • Save ryanwilson/df809cb4f7c59aa9a0d8a002b91efb39 to your computer and use it in GitHub Desktop.
Save ryanwilson/df809cb4f7c59aa9a0d8a002b91efb39 to your computer and use it in GitHub Desktop.
SwiftUI failure with @binding and @State
struct SwiftUIPlayground: View {
@Binding var isOn: Bool
var body: some View {
Text("ON").scaleEffect(isOn ? 10 : 1)
}
}
struct SwiftUIPlayground_Previews: PreviewProvider {
@State static var isOn: Bool = false
static var previews: some View {
SwiftUIPlayground(isOn: $isOn)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment