标签:span gate bsp back ati hang func space nsrange
1.遵循代理
UITextFieldDelegate
2.设置代理
textf.delegate = self
3.实现代理
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
let text = textField.text!
let len = text.characters.count + string.count - range.length
return len<=6
}
标签:span gate bsp back ati hang func space nsrange
原文地址:http://www.cnblogs.com/chenxiaopao/p/7802051.html