I have added textfield (keyboardTextField) and UISwitch on top of my custom keyboard. I can set focus ON or OFF for (keyboardTextField) on the base of Switch value my code.
- (void)switchToggled:(id)sender
{
UISwitch *mySwitch = (UISwitch *)sender;
if ([mySwitch isOn])
{
[keyboardTextField becomeFirstResponder];
}
else
{
[keyboardTextField resignFirstResponder];
}
}
So whats happening right now at first time when my custom keyboard launch its working in each app of my device,But it's impossible for me to select the input view of the main app back after changing Switch value to On and then OFF and now my custom keyboard can't write any thing in any app of my device.
This type of questions already has been asked here and here but no one answered yet. If someone have any workaround or any ideas, Please share.