2

I'm wondering if there's anyone else out there that has come across this problem or that might be able to help?

Essentially, i am using a custom keyboard on a screen within my app.

On the screen there are x4 text fields. On load, the first responder is the first text field. This still works perfectly in ios6. The problem comes when data is added into the first text field - it should fire UIControlEventEditingChanged (as in ios5) but it doesn't. In ios5 this triggers checks on the data entered and when appropriate changes the first responder to the next text field. The code for that is:

[self.field addTarget:self
                action:@selector(textFieldDidUpdate:)
      forControlEvents:UIControlEventEditingChanged];

To isolate the problem, i tested the code above on a text field using a standard keyboard and it works in ios6 which makes me think it has got to be something about the custom keyboard that is introducing the ios6 issue - perhaps something i should have been doing in ios5 but was been automatically managed for me.

It's worth noting that i am still able to touch into all four of the fields - so it's a different problem to the one other people have been asking questions about.

I use this code to hide the keyboard:

id keyboardImpl = [objc_getClass("UIKeyboardImpl") sharedInstance];
[keyboardImpl setAlpha:0.0f];

Each field reloads the keyboard.

I also have a warnings i don't know how to fix on:

id keyboardImpl = [objc_getClass("UIKeyboardImpl") sharedInstance];

Implicitly declaring library function 'objc_getClass' with type 'id (const char *)'

and

Instance method '-sharedInstance' not found (return type defaults to 'id')

Slightly separate note, i have heard that sometimes keyboards of this type get rejected by apple also interested to hear if anyone have any experience of this?

Thanks :)

  • I am now also experiencing this problem and trying to find a way to get the controlEvent to fire. Have you resolved this yet? – msec Nov 26 '12 at 11:23

2 Answers2

1

ok so I just got it working, here is an example from myCustomKeyboard method. I hope this answer is relevant to you

- (IBAction)button0Pressed {
self.textField.text = [self.textField.text stringByAppendingString:@"0"];
[self.textField sendActionsForControlEvents:UIControlEventEditingChanged];
[self playSound];
}

the main addition being

[self.textField sendActionsForControlEvents:UIControlEventEditingChanged];

then in my other class I have this

[[doubleCheckAlertView textFieldAtIndex:0] addTarget:self action:@selector(testMethod) forControlEvents:UIControlEventEditingChanged];

and

-(void) testMethod {
//Do something
}
msec
  • 252
  • 5
  • 20
  • btw have you been able to release apps onto the app store using your custom keyboard? – user1837078 Nov 27 '12 at 01:30
  • No worries, I'm glad it worked for you just as it did for me. I haven't released anything onto the app store yet using a custom keyboard. However, my understanding is that it is acceptable given that apple provided the .inputview property for UItextfields – msec Nov 27 '12 at 09:45
0

After finally solving these custom keyboard issues for iOS6, iOS7 is now showing a background behind all the custom keyboards i've created. The background is in the shape of the standard keyboard. Has anyone else experienced this problem with custom keyboards in iOS7? Or know how to fix this issue?