获取选中的文本
NSRange range = self.inputTextView.selectedRange;
NSString *txt = [self.inputTextView.text substringWithRange:range];
回车取消键盘(在代理方法中实现)
-(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{
if ([text isEqualToString:@"\n"]) {
[_inputTextView resignFirstResponder];
return NO;
}
return YES;
}