I'm sorta new to swiftUI, and I don't fully know how stuff like @Binding and @State work, but I have a view that changes a text from a variable passed to the view through:
A simple example of this would be:
I have tried to figure out how to turn a String to a Binding<String> but I cant figure it out.
Code Block @Binding var str: String
A simple example of this would be:
Code Block struct TextView: View { @Binding var str: String var body: some View { Text($str.wrappedValue) } }
Though when I try to send a string when I call the view it gives me the error: Cannot convert the value of type 'String' to expected argument type 'Binding<String>I have tried to figure out how to turn a String to a Binding<String> but I cant figure it out.