Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.