func textField(textField:UITextField, shouldChangeCharactersInRange range:NSRange, replacementString string:String) ->Bool{
if(range.length==1&& string.characters.count==0) {
return true
}
elseif(textField.text?.characters.count>=14) {
textField.text= textField.text?.substringToIndex((textField.text?.startIndex.advancedBy(14))!)
return false
}
return true
}
网友评论