↧
Answer by Dávid Pásztor for How to convert a boolean expression to Binding in...
You need to use the Binding(get:set:) initialiser.var body: some View { let binding = Binding<Bool>(get: { self.whether_go == "YES" }, set: { if $0 { self.whether_go = "YES"} else {...
View ArticleHow to convert a boolean expression to Binding in SwiftUI?
I have a textfield, and I am trying to goto another view when user input a specific string.import SwiftUIstruct ContentView: View { @State var whether_go = "No" var body: some View { TextField("Goto?",...
View Article