I’m trying to hide the iPad keyboard on a modal view, which has the FormSheet style. I tried to resignFirstResponder, but nothing happens. Is this a bug or doesn’t this work at all?
best regards
EDIT
-(void)hideKeyboards
{
[emailField resignFirstResponder];
[passwordField resignFirstResponder];
[confirmPasswordField resignFirstResponder];
}
-(IBAction)emailFieldDone:(id)sender
{
[self hideKeyboards];
}
-(IBAction)passwordFieldDone:(id)sender
{
[self hideKeyboards];
}
-(IBAction)confirmPasswordFieldDone:(id)sender
{
[self hideKeyboards];
}
Overriding
disablesAutomaticKeyboardDismissalto return NO as below fixed the same problem of mine. You need to overridedisablesAutomaticKeyboardDismissalofUINavigationController, not the own view controller, to fix this issue. Maybe use a category is a good idea:Also, check this iPad keyboard will not dismiss if modal view controller presentation style is UIModalPresentationFormSheet question if you want to get a detailed explanation.