I'm trying to write . Custom Keyboard Extension
I am looking for a way to find out where the cursor is on UITextField, UITextView... etc. in CustomKeyboardExtension ... but I don't see anything like it.
I saw a SwiftKey application ( http://swiftkey.com ) can do this (or do something similar). When I change the cursor, the text of the sentence will change (see the figures below).
Q: How can we get the current selection of text?
...
UPDATE: 09/29/2014
OK, I'm so stupid. We can use methods documentContextBeforeInput, documentContextAfterInputproperties textDocumentProxy. I thought Before, After, is the time. In fact, this is about the position.
Excuse me! I wasted your time :(
source
share