Force lowercase - ios swift
问题 I would like to force lowercase in an UITextfield when the user is typing. I came out so far with this code, but seems like it's not lowering characters. func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool { if string.characters.count == 0 { return true } let currentText = textField.text ?? "" let prospectiveText = (currentText as NSString).stringByReplacingCharactersInRange(range, withString: string.lowercaseString)