I'm currently developing a custom keyboard app and am having trouble parsing what the keyboard has outputted onto the text document proxy. How does one go about this? I feel like I'm losing my mind. Currently I'm looping:
for letter in (proxy.documentContextBeforeInput?.characters)!
However, this is only getting the text on the line the cursor is currently on, before the cursor, such that if my textDocumentProxy contains:
Some text above
Some text below (cursor position)
My loop only iterates throught the "Some text below" portion.
Is there any way to loop through the entirety of a UITextDocumentProxy? Thank you.