0Pricing
SwiftUI Academy · Lesson

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 binding

All lessons in this course

  1. Why Children Need @Binding
  2. Passing a Binding Down
  3. Building a Reusable Toggle Row
  4. @State vs @Binding
← Back to SwiftUI Academy