Thursday, July 24, 2014

Hide keyboard (if open) when app enters in background


- (void)applicationDidEnterBackground:(UIApplication *)application {

  for (UIWindow *keyboardWindow in [[UIApplication sharedApplication] windows])   {

        if ([[keyboardWindow description] hasPrefix:@"<UITextEffectsWindow"] == YES) {
            [keyboardWindow resignFirstResponder];
        }
   }

}

No comments:

Post a Comment