Passing a Binding Down
Send state into a subview with the dollar sign.
The Dollar Sign
To turn @State into a binding you pass it, prefix the property with a dollar sign. That hands the child a live connection.
Value vs Binding
Plain name gives the current value. The dollar-prefixed name gives the binding. Same property, two ways to use it.
var count = 0
// count -> the value
// $count -> the bindingAll lessons in this course
- Why Children Need @Binding
- Passing a Binding Down
- Building a Reusable Toggle Row
- @State vs @Binding