who is issuing my UIKeyboardDidHideNotification?

亡梦爱人 提交于 2019-12-02 04:15:07

You have no way to register for a UIKeyboardDidHideNotification coming from a specific controller.

If using UIKeyboardWillHideNotification, you could check if one of the UITextView inside your controller is the first responder.

Using UIKeyboardDidHideNotification I guess you need to use delegate methods for all your UITextView and save the last one that was edited. I don't think of any other alternative.

Else, if the issue is to perform the method called by UIKeyboardDidHideNotification only on the visible controller, the solution by @sviatoslav-yakymiv works well.

Object for UIKeyboardDidHideNotification is always nil. Try to add observer in viewWillAppear and remove in viewDidDisapper methods.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!