- textField 添加target 触发条件 UIControlEventEditingChanged ,响应 textField 编辑时的内容改变事件
[self.textFeild addTarget:self action:@selector(passConTextChange:) forControlEvents:UIControlEventEditingChanged];
- 处理响应
- (void)textFieldEditingChanged:(UITextField *)textField{
NSUInteger textLength = textField.text.length;
if (!textLength) {
textField.font = [UIFont systemFontOfSize:12.0f];
}else {
textField.font = [UIFont systemFontOfSize:20.0f];
}
}