2

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 .

Ashish
  • 25
  • 8

2 Answers2

2

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

nurnachman
  • 4,468
  • 2
  • 37
  • 40
1

Use UITextChecker. It provides both completions and auto-correct options for any word.

Jeet
  • 1,030
  • 2
  • 10
  • 20