开发者

UITextView didEndEditing isn't called on iPad

开发者 https://www.devze.com 2023-04-06 23:05 出处:网络
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 met开发者_运维技巧hod to be called so th

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 met开发者_运维技巧hod to be called so that I basically can access the written text.

Any Advice?


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];
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号