views:

307

answers:

1

Hi,

Is there a way to dismiss the keyboard from MFMailComposeViewController ? If the user rotates the device, I am loading a separate controller without "send" or "cancel" being pressed, and the keyboard is remaining on screen. Is there an way to dismiss the keyboard without "done" or "send" being pressed?

Thanks in advanced guys and gals. I appreciate your help.

A: 

You can find the first responder and ask it to resign active which should dismiss the keyboard.

    UIWindow* keyWindow = [[UIApplication sharedApplication] keyWindow];
UIView* firstResponder = [keyWindow performSelector:@selector(firstResponder)];
[firstResponder resignFirstResponder];
Roger Nolan
Wow, this worked like a charm... Thanks
Yuri