Reputation: 25
I am developing an ios 8 custom keyboard application . I want to add an predictive bar and auto correction in that app extension . For that i have implement UILexicon class . My code is which i have written in viewDidLoad method of Keyboard class:
[self requestSupplementaryLexiconWithCompletion:^(UILexicon *lexicon1){
lexicon = lexicon1; // lexicon is a global object which i have declare in file
}];
//for checking this i have done :
for(int i = 0 ; i<[[lexicon entries] count] ; i++){
UILexiconEntry *lexiconEntry = [[lexicon entries] objectAtIndex:i];
NSLog(@"Lexicon entry user input is the : %@" , lexiconEntry.userInput);
NSLog(@"Lexicon entry document text proxy is the : %@" , lexiconEntry.documentText);
}
But it print every time which is saved in our phone . No any prediction and autocorrection another than these . Have you any idea how can we handle this thing .
Upvotes: 2
Views: 888
Reputation: 1040
Use UITextChecker. It provides both completions and auto-correct options for any word.
Upvotes: 1
Reputation: 4565
Apple doesn't provide an API for their QuickType keyboard, autocorrect and word prediction services. If you want, you need to implement them yourself.
Upvotes: 2