NSInteger loca = textView.selectedRange.location;//当前所选位置
NSString*insert = @"😿";
NSMutableString *mtext = [[NSMutableString alloc]initWithString:textView.text];
[mtext insertString:insert atIndex:loca];
//缓存原始起始位置
UITextPosition *begin = textView.selectedTextRange.start;
UITextPosition *end = textView.selectedTextRange.end;
textView.text= mtext;//完成插入
//起始位置偏移插入字符串长度
begin = [textView positionFromPosition:begin offset:insert.length];
end = [textView positionFromPosition:end offset:insert.length];
//恢复光标位置到新插入的字符串后面
textView.selectedTextRange = [textView textRangeFromPosition:begin toPosition:end];
[self textViewDidChange:textView];//插入指定Position字符不会调用change代理,需要手动调用