As the title in this question. I want to check if delete key is pressed. I knew about this code below:
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
if string.characters.count == 0 && range.length > 0 {
// Back pressed
print("OK")
}
return true
}
But when the textField is empty, this function is not called. So, how to check that case?
Thanks