Skip to content

carloskekwa/Custom-Keyboard-Prediction

Repository files navigation

Custom-Keyboard-Prediction for Keyboard extension in iOS (Work on Real Device Only)

Work on Real Device Only !!!!!!!!!!!!!

Description

PredictionForKeybpard is the best iOS Library that make Next Word Prediction easy for Custom iOS Keyboard. Since Apple does not support and does not provide any API for that, we decided to make a library that does that. Just Enjoy and buy me a coffee one day!

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

Custom-Keyboard-Prediction is available through CocoaPods. To install it, simply add the following line to your Podfile:

     pod 'PredictionForKeyboard'
     pod install

App Groups

Enable App Groups. Let the groups name be 'group.com.code.testingpredictionframework'. Otherwise the library will crash.

alt text

Copy Bundle Resources

Add Bundle Resource (+)

alt_text

alt_text

alt_text

alt_text

alt_text

alt_text

alt_text

alt_text

Implementation

Mainly you will use this Library in a Custom Keyboard Prediction. So to do that :

Import the Framework this way.

    #import <PredictionForKeyboard/predictWord.h>

Wherever u want to predict. init First time initialization may take up to one minute.

    @implementation
    predictWord *predict; 
    -(void)viewDidLoad{
     predictWord *predict = [[predictWord alloc] init];
    [predict initRealmWords:^(BOOL success) { 

    }];
    }

Array of next word prediction after initRealmWords Finish

    [predict getPrediction:@"how are you " completion:^(NSArray *suggestions, UIColor *textColor) {
        NSLog(@"%@:",suggestions); 
    }];

Array of word List Prediction

      [predict getPrediction:@"how are you" completion:^(NSArray *suggestions, UIColor *textColor) {
        NSLog(@"%@:",suggestions); 
     }];

No space on the right will give u word prediction and with a space will give the next word prediction. Just Give it any syntaxe and it will find the Prediction for it. The Array returned is mainly an array with many words ranked from the highest to the lowest.

Author

carlos kekwa, [email protected]

License

PredoctionForKeybpard is available under the MIT license. See the LICENSE file for more info.

About

Prediction Framework for iOS Keyboard Extension

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published