How to programmatically remove keyboard from textview

Is there a way to hide or not show the keyboard without calling resignFirstResponderin iOS? I know another way to hide the keyboard, firstly, to make the text view not editable, or using

- (BOOL)textFieldShouldEndEditing:(UITextView *)textview
{
    [textview resignFirstResponder];
}

but in my case this method will not work, because I just want to reject or hide only the keyboard, but I need editing in a textview. I have a text view that contains some text, when I click on the sentence to be selected, I do this part of the selection well, but when I write the keyboard rejection method in my project above, the selection of the knocked sentence does not appear Is there any way to get it.

+3
source share
2 answers

, . , .

, . , ,

    textview.inputView = [[UIView alloc] init];

.

+4

self.textView.editable = NO;

NSRange selection = [yourTextView.text rangeOfString:yourTextView.text]; 
if( selection.location != NSNotFound ){ yourTextView.selectedRange = selection; }

. , .

+1

All Articles