romaonthego / REFrostedViewController

iOS 7/8 style blurred view controller that appears on top of your view controller.
MIT License
2.96k stars 494 forks source link

Dismiss Keyboard When Slide Menu Appears #53

Closed xh208 closed 10 years ago

xh208 commented 10 years ago

Currently, if a keyboard is active when the side menu is invoked then the keyboard remains active whereas a more intuitive behaviour would be to dismiss the keyboard, if possible.

thorst commented 10 years ago

Just ran into this today as well. It should either hide the keyboard, or go on top of the keyboard (not sure if thats possible, or desired).

thorst commented 10 years ago

I fixed this by modifying the following functions in NavController.

- (void)showMenu
{
    [self.frostedViewController.view endEditing:YES];
    [self.frostedViewController presentMenuViewController];
}
- (void)panGestureRecognized:(UIPanGestureRecognizer *)sender
{
    [self.frostedViewController.view endEditing:YES];
    [self.frostedViewController panGestureRecognized:sender];
}

I think you could also use the following, but i just went off the view of the frostedviewcontroller. Not sure if there is a difference, or which would be better.

[self.view endEditing:YES];
thorst commented 10 years ago

did you put this in the current build? Or just close it?

romaonthego commented 10 years ago

I just closed it. Your solution should work fine.

thorst commented 10 years ago

but its not documented or in the demo. Would it be possible to add to the demo?

romaonthego commented 10 years ago

Sure, thanks!

thorst commented 10 years ago

thanks!