depicus

changing the digital world one bit at a time...

Blants (noun) the rants of a blogger

iDev – hiding the keyboard for a UITextView

August 5, 2010 by The Man

Lots of into for a UITextField but not a UITextView.

- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
    if ([text isEqualToString:@"n"])
    {
        [textView resignFirstResponder];
        return NO;
    }
    return YES;
}