Open Sammcb opened 2 years ago
The reason is that State
must declare init(projectedValue: Binding<Value>)
.
Property wrappers can enable passing a projected-value argument to a property-wrapped parameter by declaring var projectedValue, and implementing an init(projectedValue:) that meets the following requirements: [...]
Describe the bug In SwiftUI 3, support was added for using a binding of an element in a collection.
This allows for using a binding to a value and reading the value. Currently this behavior is not supported in Tokamak. In the example above, I get an error on
$direction in
sayingThis isn't a big issue since you can technically use a ForEach on the count and index into the collection, but would be a nice to have!
Expected behavior Using a binding would work in the above code snippet.
Desktop (please complete the following information):
Thanks!