Skip to content

Instantly share code, notes, and snippets.

@chriseidhof
Created September 23, 2019 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chriseidhof/55743a3f36ee57085fd80e329c36adc5 to your computer and use it in GitHub Desktop.
Save chriseidhof/55743a3f36ee57085fd80e329c36adc5 to your computer and use it in GitHub Desktop.
struct ContentView: View {
@State var prop: Bool = true
var body: some View {
VStack {
Rectangle()
.fill(prop ? Color.red : Color.green)
.frame(width: prop ? 100 : 300, height: prop ? 50 : 200)
.animation(.linear)
Spacer()
Toggle(isOn: $prop, label: { Text("Toggle") })
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment