Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Does this answer your question? How to initialize a Binding : Bool variable in SwiftUI? Commented Mar 23, 2023 at 13:28
  • @loremipsum No, it is not the same, because there is defined type, and here we have generic type. That difference is the key here. Commented Mar 23, 2023 at 16:08
  • The issue is the missing wrapper, if you add it as normal and init like that question self._selection = selection it will work. To make it work now just remove the $ it is already a Binding you don't need it but you will have UI update issues, you need the @Binding Commented Mar 23, 2023 at 16:20