I have a UITextField with date picker, and I want to use the default built in button to clear the text field, it doesn't seems to work.
I tried overriding
func textFieldShouldClear(_ textField: UITextField) -> Bool {
searchBar.text = "" //my textfield is called searchBar and I tried to clear the text like that
return true
}
It seems that the method is called and printing the textfield says its empty but its not and in the view shows the last date I entered. Any ideas? Thanks in advance.