Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

textViewDidEndEditing is not called

I'm new to iOS development.

I have written header file following like this

@interface TextView : UITextView <UITextViewDelegate, UIPopoverControllerDelegate>

in TextView.h.

The implementation file code is following :

- (BOOL)textViewShouldBeginEditing:(TextView *)textView
{
    ZWLog(@"called should begin edit");
    return YES;
}

- (void)textViewDidBeginEditing:(TextView *)textView
{
    ZWLog(@"called did begin edit");
}

- (BOOL)textViewShouldEndEditing:(TextView *)textView
{
    ZWLog(@"called should end editing");
    return YES;
}

- (void)textViewDidEndEditing:(TextView *)textView
{
    ZWLog(@"view did end edit");
    return YES;
}

- (BOOL)textView:(TextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
    //my own code
    return YES;
}

- (void)textViewDidChange:(TextView *)textView
{
   //my own code
}

When i start typing a character in UITextView, I got response from

  • textViewShouldBeginEditing.
  • textViewDidBeginEditing.
  • shouldChangeTextInRange.
  • textViewDidChange.

But I didn't get any response from textViewDidEndEditing or textViewShouldEndEditing. Do you have any idea why these are not getting called?

Thanks for your answers.

like image 705
Kirubachari Avatar asked Sep 04 '13 07:09

Kirubachari


1 Answers

textViewDidEndEditing is called when textfield resigns its first responder, when the keyboard disappears.

like image 150
Nico Avatar answered Oct 05 '22 22:10

Nico