Reputation: 51
I'm making a custom keyboard for iOS8, and I managed to do my own return key, using [self.textDocumentProxy insertText:@"\n"];
But that also dismiss the keyboard, which I don't want. I need the keyboard to stay on.
I tried to make my UIInputViewController delegate of UItextField to access the textfieldShouldEndEditing delegate method, but it's never fired. It seems like it is impossible access the currently edited UITextfield from the custom keyboard.
Is there any way to prevent the keyboard to dismiss when my return key is pressed ?
Cheers,
Upvotes: 0
Views: 1337
Reputation: 2352
Showing/Dismissing a keyboard - whether default iOS, or a custom extension - is application-controlled behavior (hence the delegate methods in UITextField), and CANNOT be controlled by the keyboard itself.
The keyboard and the host application run in isolated, sandboxed processes and cannot directly control each other. The methods for the application/keyboard to interact with each other are ONLY the ones exposed by Apple, and these at the moment, do not include a way for the keyboard extension to control when it is shown or hidden.
Upvotes: 3