Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hiding the UIKeyboard

I am trying to hide the keyboard in my SplitView application (because it covers over part of the root menu). However, the only thing I can find is how to hide the keyboard after a textfield has been used [TextField resignFirstResponder].

Is there any other way to hide the keyboard?
Ideally I would like to use the barButtonItem, which displays the menu, as a trigger to hide the keyboard.

like image 437
BloonsTowerDefence Avatar asked Aug 15 '12 17:08

BloonsTowerDefence


1 Answers

Use this:

[[[UIApplication sharedApplication] keyWindow] endEditing:YES];
like image 138
Steven Fisher Avatar answered Sep 20 '22 15:09

Steven Fisher