2

I have a modal View Controller, presented as Form Sheet on the iPad. When I send [textField resignFirstResponder], the Keyboard remains on the screen.

In the View Controller:

- (BOOL)textFieldShouldEndEditing:(UITextField *)textField
{
    return YES;
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];

    return YES;
}

In the Navigation Controller:

- (BOOL)disablesAutomaticKeyboardDismissal
{
    return NO;
}

All this worked using iOS 6, but not with iOS 7.

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Vyax
  • 21
  • 1
  • 4
  • Please refer to my answer here which works fine: http://stackoverflow.com/a/23195187/527539 – ZYiOS Apr 21 '14 at 10:09

1 Answers1

1

Adding the following method to the actual ViewController (rather than the NavigationController) worked for me in iOS 7.

- (BOOL)disablesAutomaticKeyboardDismissal
{
    return NO;
}

I'm calling a method that is hooked to the Text Field's Sent Event Editing Did End.

- (IBAction)KeyboardDoneKeyPressed:(id)sender
{
   [sender resignFirstResponder];
}

Prior to adding the method disablesAutomaticKeyboardDismissal the keyboard would not dismiss when pressing Done.

AHoepelman
  • 11
  • 2