Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plugin interrupted, invalidated errors for custom keyboard

All of a sudden, a project that used to run well on iOS simulator no longer works. Whenever I try switching to the custom keyboard, I get two errors:

1) plugin com.XXX.XXX.KeyBoardName interrupted

2) plugin com.XXX.XXX.KeyBoardName invalidated

I tried resetting the simulator, rebooting Xcode, etc. - everything to no avail. Happy to provide more details if helpful!

Edit:-
I am using this sample code https://github.com/bjhstudios/iOSCustomKeyboard.
The above sample is working fine. The problem is when I switch the keyboards between native and custom, after some time, I get this error is log and suddenly, custom keyboard disappear. Then, again, I have to go to Simulator Settings and add the custom keyboard.

like image 992
vk2015 Avatar asked Jul 14 '15 20:07

vk2015


1 Answers

The problem is in your code, i have faced with this too. Look at my old code

let keyboardNib = UINib(nibName: "ChatCustomKeyboardView", bundle: nil) customKeyboardView = keyboardNib.instantiateWithOwner(self, options: nil)[0] as! UIView view.addSubview(customKeyboardView) 

Then i changed it to this

let nib = UINib(nibName: "ChatCustomKeyboardView", bundle: nil) let objects = nib.instantiateWithOwner(self, options: nil) view = objects[0] as! UIView; 

and everything start working. So try to assign your view but not add as subview.

like image 56
Bohdan Savych Avatar answered Sep 22 '22 13:09

Bohdan Savych