How to clear a TextField on button press? (Swift)
Solution 1:
I figured it out:
TextField("Message", text: $message)
.textFieldStyle(RoundedBorderTextFieldStyle())
Button(action: {
self.chatModel.addMessage(message)
message = ""
}) {
Text("Send")
}