admin管理员组文章数量:1125970
I am able to retrieve the text in the input field by doing:
let contextBeforeInput = textDocumentProxy.documentContextBeforeInput ?? ""
let contextAfterInput = textDocumentProxy.documentContextAfterInput ?? ""
let fullText = contextBeforeInput + contextAfterInput
However, when I'm pasting text into the input field, textDocumentProxy.documentContextBeforeInput
refuses to return the entire text from the input field but instead only returns the last two sentences.
I have tried this with the input fields in WhatsApp, Signal, and Telegram and it's all the same, so it doesn't seem to be caused by the specific app.
At first I thought it was a limitation imposed by Apple but other third party keyboard extensions such as Grammarly are able to pick up the whole pasted text from the input field, so how are they doing it?
本文标签: uikitRetrieve input field text as a keyboard extension in SwiftStack Overflow
版权声明:本文标题:uikit - Retrieve input field text as a keyboard extension in Swift - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736644182a1946066.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论