0


I have seen many questions about iphone custom keyboard. But, I cannot find a good tutorial and the one that can be customized easily.
I have found out this which is easy to customise and also have popup text when user press the key. . https://github.com/kulpreetchilana/Custom-iOS-Keyboards

#define kChar_shift @[ @"ਔ", @"ਐ", @"ਆ", @"ਈ", @"ਊ", @"ਭ", @"ਙ", @"ਘ", @"ਧ", @"ਝ", @"ਢ",       @"ਓ", @"ਏ", @"ਅ", @"ਇ", @"ਉ", @"ਫ", @"ੜ", @"ਖ", @"ਥ", @"ਛ", @"ਠ", @"◌ੰ", @"◌ੱ", @"ਣ", @"ਫ਼", @"ਜ਼", @"ਲ਼", @"ਸ਼", @"ਞ" ]


I want to implement keyboard for other language. That tutorial can do for other language but I cannot edit it to show original English keyboard. (Switched by button in inputAccessoryView).If possible, i would like to know how to do or where to edit in this.

In .h

@property (strong) id<UITextInput> textView;

In .m

-(void)setTextView:(id<UITextInput>)textView {

if ([textView isKindOfClass:[UITextView class]])
    [(UITextView *)textView setInputView:self];
else if ([textView isKindOfClass:[UITextField class]])
    [(UITextField *)textView setInputView:self];

_textView = textView;
}

-(id<UITextInput>)textView {
return _textView;
}


- (id)init
{
if (self) 
{
    NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"PMCustomKeyboard" 
    owner:self  options:nil];
    [[nib objectAtIndex:0] setFrame:frame];
    self = [nib objectAtIndex:0];  
}
}
Khant Thu Linn
  • 5,905
  • 7
  • 52
  • 120

2 Answers2

0

Not sure if this article about creating custom keyboard and switching between the default and the custom keyboard can help you - http://thekspace.com/home/component/content/article/63-ioscustomkb.html

It comes with a sample Xcode project that you can download and try.

K S
  • 212
  • 1
  • 1
0

You have to handle inputView and inputAccessoryView properties as described here.

Community
  • 1
  • 1
Rivera
  • 10,792
  • 3
  • 58
  • 102