Assigning Character Limit to a Specific UITextField
问题 The following code works but applies to all TextFields. How can I limit it to one specific TextField? Code: func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { let currentCharacterCount = (textField.text?.characters.count) ?? 0 if (range.length + range.location > currentCharacterCount){ return false } let newLength = currentCharacterCount + string.characters.count - range.length return newLength <= 9 } 回答1: Assuming