观察更改 [_textField addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventEditingChanged];
避免执行两次
-(void)valueChanged:(UITextField *)textField{
UITextRange *selectedRange = textField.markedTextRange;//获取高亮部分
if (selectedRange == nil || selectedRange.empty) {
// NSLog(@"selectedRange text = %@", textField.text);
// 自动义请求
}else{
return;
}
}