Question

The method textViewDidEndEditing is not called when you dismiss the keyboard on the iPad with the button in the right corner at the button. However, i want the method to be called so that I basically can access the written text.

Any Advice?

Was it helpful?

Solution

Observe UIKeyboardDidHideNotification:

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(keyboardDidHide:) 
                                             name:UIKeyboardDidHideNotification 
                                           object:nil];

- (void)keyboardDidHide:(NSNotification *)note {
    // Whatever you want
}

Don't forget to call removeObserver: in dealloc:

- (void)dealloc {
  [[NSNotificationCenter defaultCenter] removeObserver:self];
  [super dealloc];
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top