Removes the keyboard by clicking a non-text box on any screen.
To implement this function during development, you only need to copy the following code to the project you want to implement.
The Code is as follows:
-(Void) viewdidload {[Super viewdidload]; [self setupfordismisskeyboard];}-(void) setupfordismisskeyboard {nsicationicationcenter * NC = [nsicationicationcenter defacenter center]; using * singletapgr = [[using alloc] Using: Self action: @ selector (using :)]; nsoperationqueue * mainquene = [nsoperationqueue mainqueue]; [NC addobserverforname: Using Object: Nil queue: mainquene usingblock: ^ (nsnotification * Note) {[self. view addgesturerecognizer: singletapgr];}]; [NC addobserverforname: uikeyboardwillhidenotification object: Nil queue: mainquene usingblock: ^ (nsnotification * Note) {[self. view removegesturerecognizer: singletapgr];}-(void) tapanywheretodismisskeyboard :( uigesturerecognizer *) gesturerecognizer {// This method will replace self. the first responder of all subviews in the view is resign out [self. view endediting: Yes];}