In my iOS keyboard extension, I have a function that moves the cursor backwards as follows:
(textDocumentProxy).adjustTextPositionByCharacterOffset(-1)
and displays the words right before the cursor in a UILabel using the textDocumentProxy.documentContextBeforeInput
function provided by Apple. The problem is, whenever an emoji appears inside the label, it starts being separated as such:
Is there any way of avoiding this? Does it have anything to do with me hardcoding the -1? I've tried using str.utf16.count
but that just doesn't scroll at all for some reason. Any help would be greatly appreciated.
Here's my question from a few months ago that never got answered