I'd like to make a boolean var true if a string var contains a comma. but keep getting an error
import SwiftUI
struct ContentView: View { @State var dos = "" @State var coma : Bool = false var body: some View { Form { TextField("dosis", text: $dos) if dos.contains(",") == true{ coma == true } } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }