【问题标题】:Want to implement prediction and autocorrection in ios 8 custom keyboard application想要在 ios 8 自定义键盘应用程序中实现预测和自动更正
【发布时间】:2014-12-15 00:27:27
【问题描述】:

我正在开发一个 ios 8 自定义键盘应用程序。我想在该应用扩展中添加预测栏和自动更正。为此,我已经实现了 UILexicon 类。我的代码是我在 Keyboard 类的 viewDidLoad 方法中编写的:

    [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);
    }

但它每次都会打印,保存在我们的手机中。除了这些之外,没有任何预测和自动更正。 你知道我们该如何处理这件事吗?

【问题讨论】:

    标签: ios8 custom-keyboard ios8-extension


    【解决方案1】:

    Apple 不为其 QuickType 键盘、自动更正和单词预测服务提供 API。如果需要,您需要自己实现它们。

    【讨论】:

      【解决方案2】:

      使用 UITextChecker。它为任何单词提供完成和自动更正选项。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2015-08-05
        • 2014-08-28
        • 1970-01-01
        • 2015-02-19
        • 2014-11-24
        • 2014-08-11
        相关资源
        最近更新 更多