I used a tableView as a registration screen and I need to enforce some length limitation to every row. I used the function below but it lets all the fields have the same constraint. Does anyone know how to handle it?
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
let maxLength = 12
let currentString: NSString = textField.text! as NSString
let newString: NSString =
currentString.replacingCharacters(in: range, with: string) as NSString
return newString.length <= maxLength
}