ios8custom-keyboardios8-extension

Want to implement prediction and autocorrection in ios 8 custom keyboard application


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 .


Solution

  • Apple doesn't provide an API for their QuickType keyboard, autocorrect and word prediction services. If you want, you need to implement them yourself.