I'm creating a custom iOS 8 keyboard as a pet project.
I'm trying to replicate the system keyboard as accurately as possible, but building it from the ground up.
I'm largely done with this. The final hurdle I'm encountering is with adding autocorrect to my keyboard. Is there a way I can have the autocorrect behave as it would on the regular system keyboard?
The UILexicon documentation is quite sparse.
EDIT:
Making some progress with this. UILexicon's requestSupplementaryLexiconWithCompletion:
method appears to only be returning results from my device's Contacts and keyboard shortcuts. I then went on to see how to autocorrect an NSString and found the UITextChecker class, which has been available since iOS 3.2.
Using this approach I can achieve autocorrect suggestions on individual words, but I'm still investigating the ability to add context-aware autocorrect (e.g. correcting "arctic monkeys" to "Arctic Monkeys").