小任班长的博客 - iOS uitextfield length limit
type: channel
link: https://cnxiaocheng.top/tag/iOS-uitextfield-length-limit/
items: iOS uitextfield长度限制 手机号长度验证

iOS uitextfield长度限制 手机号长度验证
type: item
date: 2020-07-06T08:00:00+08:00
description: iOS uitextfield长度限制[textUsername addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged]; - (void)textFieldDidChange:(UITextField *)textField { if (textField == textUsername) { if (textField.text.length > 9) { textField.text = [textField.text substringToIndex:9]; } } }