Search code examples
iosobjective-ckeyboardios-app-extension

iOS keyboard dismiss button for custom keyboards


I am creating a custom keyboard extension for iOS 8. I am trying to implement the dismiss/hide keyboard button. I am using UITextDocumentProxy to edit the text and insert characters. How can I implement something like this:

[textView resignFirstResponder];

but for self.textDocumentProxy?


Solution

  • The document says: use - dismissKeyboard method.

    Because a custom keyboard does not have access to the current text input object, you cannot send it a resignFirstResponder message (as you would to dismiss the system keyboard when you are developing an app with text entry). To dismiss the custom keyboard, call dismissKeyboard instead.