Quantcast
Channel: How to convert a boolean expression to Binding in SwiftUI? - Stack Overflow
Browsing all 2 articles
Browse latest View live

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 Article


How 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

Browsing all 2 articles
Browse latest View live


Latest Images