IOS 8 switch apps cause keyboard to tilt, pointInside behaves differently

A very strange iOS 8 bug.

  • My iOS app has UIViewController


  • When in edit mode they need more help dropping the keyboard when pressed outside
  • I fixed it in iOS 7 by adding something like this in each VC

    - (void)keyboardWasShown:(NSNotification*)notification
        id responder = [UIResponder currentFirstResponder];
        if ([responder isKindOfClass:[UITextField class]]) {
            _textFieldResponder = responder;
        else {
            _textFieldResponder = nil;
    - (void)keyboardWillHide:(NSNotification*)notification
        _textFieldResponder = nil;
    - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event usualReturn:(BOOL)rv
        if (_textFieldResponder) {
            CGPoint pvIn = [_textFieldResponder convertPoint:point fromView:self.view];
            if (!CGRectContainsPoint(_textFieldResponder.bounds, pvIn)) {
                [UIResponder resignAnyFirstResponder];
        return rv;

and in viewDidLoad from VC

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeyboardDidShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];


This works great in iOS 7. Now in iOS 8 this also works great ...


It works fine until the 4-finger user moves to another app and then comes back. Then, when uitextfield enters edit mode, pressing the keyboard will send a touch directly to UIVew

behind it, causing pointInside

and causing the keyboard to tilt.

Could you please help me understand what is happening in the world (in iOS 8) when exiting an application that will cause it to behave so weird? Thank you so much for your help.


source to share

All Articles