Detect if UIKeyBoard is Showing [duplicate]

拟墨画扇 提交于 2019-12-20 03:34:11

问题


I'd like to detect whether or not the keyboard is showing. I've found a few other posts that traverse the subviews of UIWindow to find the keyboard, but if that is the only way then I'll figure out something else. I suppose I could also observe the UIKeyboard notifications, but I'm guessing there is a cleaner solution out there.


回答1:


I am not sure what's "dirty" in observing UIKeyboard notifications but it definitely beats traversing UIWindow hierarchy.



来源:https://stackoverflow.com/questions/3903987/detect-if-uikeyboard-is-showing

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