Skip to content

khantthulinn/SmartZawgyi

Repository files navigation

Smart Zawgyi

This is for converting Zawgyi character into proper words. It is written with Objective-C for iOS App. Implementations are extracted from TaKaung Keyboard App and moved to embedded framework.

Facebook

https://www.facebook.com/TaKaungKeyboard/

Description

Converting

Usage in Main App

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
    self.inputStr = string;
    return YES;
}

- (void)textFieldDidChange:(UITextField *)textField {
    if (!self.inputStr || self.inputStr.length == 0)
        return;
    
    textField.text = [self.convert convertExistingString:textField.text withInputCharacter:[self.inputStr characterAtIndex:0]];
}

Usage in Keyboard Extension

Convert *conv = [[Convert alloc] initWithAddTextBlock:^(NSString *str) {
        [self.textDocumentProxy insertText:str];
    } andDeleteText:^{
        [self.textDocumentProxy deleteBackward];
    }]; //Set up
       
[self.conv convertExistingText:self.textDocumentProxy.documentContextBeforeInput withInputCharacter:[character characterAtIndex:0]]; // Put all existing text and new character that user just type (1 char only)

Output

Converting

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published