Using UITextField inside a keyboard app extension

此生再无相见时 提交于 2019-12-10 20:07:52

问题


I added textfield (keyboardTextField) on top of my custom keyboard. I can select it and enter some text (using my custom keyboard). But it's impossible for me to select the input view of the main app back. This line of code

[keyboardTextField resignFirstResponder];

doesn't work correctly. If someone have any workaround or any ideas, I need your help.


回答1:


I fixed this by adding a button which switches the user input from the UILabel (in my case) to the (normal - iOS) UITextField in Messages f.e.

I check on a BOOL to see where to enter the user selected character.



来源:https://stackoverflow.com/questions/26173638/using-uitextfield-inside-a-keyboard-app-extension

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