I am developing iOS keyboard extension with handwriting recognition like MyScript Stylus, I am using ATK 2.2 SDK ATKSingleLineWidget Framework(same as you do in your app, I guess) but performance is much worse than MyScript Stylus. I would be very thankful if you can give some advices and tips. I have following issues :
1. I am doing configuration in viewDidAppear method and It's taking time to draw singleLineWidget, seems like lag.
2. Since UITextDocumentProxy gives limited functionality, I can't change entire text with singleLineWidget text, I must clear inputField and then insert recognized text, which I'am doing with deleteBackwards method. This approach causes lag.
3. How can I detect when user moves cursor on inputField to scroll singleLineWidget on proper position?
Thanks a lot for helping, you are doing great job.
For point 3, I've got a solution and I hope it will help other developers who may have same issue
UITextInputDelegate gives function textDidChange when user taps on anywhere on inputField. In this delegate method you can get documentContextBeforeInput (NSString type) from textDocumentProxy which is text before the cursor. So length of this string is current cursor position and you can easily set this to the cursorIndex property of singleLineWidget and call smoothScrollToCursor.
Thanks for your answer.
1- I am testing on iPhone 5 iOS 10, iPhone 6s iOS 11 and iPad Pro iOS 11. I've just made some optimizations now it's working great. Thanks
2-I think I didn't make clear my question, I need clear textDocumentProxy text because singleLineTextWidget is returning whole text not only new, if I call insertText method on textDocumentProxy, it will cause duplicate text
3-I have problem when user moves cursor not on the keyboard but on the input, which doesn't informs you about it