A manager for a value that provides a way to mutate it.
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
Use a binding to create a two-way connection between a view and its underlying model. For example, you can create a binding between a
Toggle and a
Bool property of a
State. Interacting with the toggle control changes the value of the
Bool, and mutating the value of the
Bool causes the toggle to update its presented state.
You can get a binding from a
State by accessing its binding property. You can also use the
$ prefix operator with any property of a
State to create a binding.