- (void)textFileChange:(NSNotification *)notification
{
UITextField *textField = notification.object;
if (textField.tag == 1024) {
UITextRange *selectedRange = [textField markedTextRange];
//获取高亮部分
UITextPosition *position = [textField positionFromPosition:selectedRange.start offset:0];
// 没有高亮选择的字,说明不是拼音输入
if (!position) {
NSString *upperCaseString = [textField.text uppercaseString];
textField.text = upperCaseString;
} else {// 有高亮选择的字符串,不做处理
}
}
}