Swiftui with delegate functions for mkmapview and uitextfield
To dismiss the keyboard when pressing return button in TextField, you can use:
UIApplication.shared.keyWindow?.endEditing(true)
Calling it on TextField's onCommit method:
TextField($searchString, placeholder: Text("Search...")) {
UIApplication.shared.keyWindow?.endEditing(true)
}
.font(.system(size: 23))
.padding()