How to make custom keyboard extension become first responder again

放肆的年华 提交于 2019-12-12 07:49:18

问题


I am making a custom keyboard extension, and in this keyboard, i have another uitextfield as a search field, so when I type on the custom keyboard, I am not sending the text to the safari's textfield or some chat app's textfield, I am sending the text to the uitextfield search field in the custom keyboard, so I can do some search and then when the search results come back, i am sending the search result to the safari's textfield or some chat app's textfield. So there is a first responder issue here. When I set the search text field as first responder, and trying to set the first responder back to the safari's textfield. It's not working any more. The question is how to set the make safari's as first responder again? after it's first responder been taking by search field.


回答1:


iOS is the sole decider on when to display a keyboard, be it a system keyboard or a custom keyboard (they are the same now).

You can add UI elements to your custom keyboard, but you cannot decide when to display the keyboard.

Apple went a long way allowing 3rd party keyboards, and as a user, I wouldn't want a keyboard popping-up without me requesting it.



来源:https://stackoverflow.com/questions/27007589/how-to-make-custom-keyboard-extension-become-first-responder-again

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