the view is done editing when a pan gesture is started or menu button is...

... tapped, so keyboard is resigned if it is currently active on the view, slight refactoring

When there is a keyboard on a view controller (on a form, for example), and a menu is activated, currently the keyboard stays up when the menu is displayed. I added [self.view endEditing:YES] when a pan gesture or menu button is activated, so the keyboard is resigned. Also, did some slight refactoring.