gresrun / GHSidebarNav

A clone of the new Facebook iOS UI paradigm
Apache License 2.0
607 stars 136 forks source link

hidden keyboard when open menu #19

Closed forsan closed 11 years ago

forsan commented 11 years ago

hello thank for amazing framework

i have problem, when use textfield in view and keyboard rise up and go to menu... the keyboard doesnt hidden... and its still appear

check image attached

iOS Simulator Screen shot Mar 19 2013 8 23 03 AM

gresrun commented 11 years ago

I'm not certain of what you are reporting. Do you want to resignFirstResponder when you open the menu?

forsan commented 11 years ago

Yes, wanna hidden keyboard when open menu...

gresrun commented 11 years ago

Well, I'm going to assume you started with my demo code since you haven't given me any code to work with here...

In GHAppDelegate.m, the revealBlock is called when a user taps the menu button so you could add a line to dismiss the current responder before opening the menu like so:

RevealBlock revealBlock = ^(){
    [self.revealController.view endEditing:YES]; // This is the line that will dismiss the current responder
    [self.revealController toggleSidebar:!self.revealController.sidebarShowing 
                                duration:kGHRevealSidebarDefaultAnimationDuration];
};
forsan commented 11 years ago

thank you its work correctly when press to button (revealSidebar method). but when use Gesture in Navigation (drag to right to open menu) the keyboard still appear...

forsan commented 11 years ago

i added [self.view endEditing:YES]; to this method - (void)dragContentView:(UIPanGestureRecognizer *)panGesture and work correctly also..

thank you again :+1:

gresrun commented 11 years ago

No problem; glad to help!