Slide 83
Slide 83 text
We have to validate String after change
● We have to check characters limit after change
func textField(_ textField: UITextField,
shouldChangeCharactersIn range: NSRange, replacementString string:
String) -> Bool {
let currentText = textField.text ?? ""
let newText = (currentText as NSString)
.replacingCharacters(in: range, with: string)
return newText.count <= 3
}