I have a textfield of type decimalPad. However, if the user types ".", "..", ... my DB will get an error.
If uesr enters the above values, I want to alert the "invalid input" syntax.
Currently my func textFieldShouldEndEditing code. How do I add code?
func textFieldShouldEndEditing(_ textField: UITextField) -> Bool {
        if Double(textField.text!) == 0 {
            let alert = UIAlertController(title: "Notice", message: "The input value can't be 0.", preferredStyle: .alert)
            let ok = UIAlertAction(title: "OK", style: .default)
            alert.addAction(ok)
            self.present(alert, animated: false)
            return false
        }
        return true
    }
 
     
     
    