Skip to content
Discussion options

You must be logged in to vote

Property wrappers' inability to fulfill protocol requirements is a known limitation in Swift. I tried to dig up an issue, but couldn't find one unfortunately. You may have better luck tracking it down than I've had, or you may want to file an issue.

If you really need a protocol here, you can adopt non-property wrapper usage:

 var isOn: BindingState<Bool> { get }
 …
-Toggle(isOn: viewStore.binding(\.$isOn)) {
+Toggle(isOn: viewStore.binding(\.isOn)) {  // no need for `$`

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kakhaberikiknadze
Comment options

Answer selected by kakhaberikiknadze
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants