so I have a binding variable that is declared in a class with:
@Binding var variableName: Bool
I am returning a view when a certain function is called. I'd like to pass the annotation into that view with:
return CustomView(variableName: $variableName)
Is this correct? I'm not sure. Also, inside the view itself, I'm not entirely sure how to do the initialization properly. The end goal is to be able to access the value of variableName from the functions of the view. Anyways, I tried declaring the following inside the CustomView class:
@Binding var variableName: Bool
For the initialization, I wasn't sure if I should pass in the variable name into the arguments (and if I should, I wasn't sure how. I also didn't know if I should somehow initialize with self.variableName = value...Just to be clear, the goal is to access the value of variableName after initialization. If I can add any more code to make this more comprehensible, let me know!