Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIText view delegate issue

I want to resign keyboard from UItextview. How to implement UItextView delegate method programmatically.

like image 987
gauri Avatar asked Aug 31 '26 21:08

gauri


1 Answers

If u want that ur keyboard is resigned when click on return then u have to write, implement this method....

- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {

if([text isEqualToString:@"\n"]) {
    [textView resignFirstResponder];
    return NO;
}

return YES;

}

Just make it copy and paste....:)

like image 187
Krunal Avatar answered Sep 02 '26 10:09

Krunal