0 votes
139 views
asked in Swift by
HI

  iOS: Hide Keyboard on App Did Enter Background or View Did Disappear?

1 Answer

0 votes
answered by (8.2k points)

HI 

 Objective-c

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    [self.window endEditing:YES];
}

Swift3.0
 func applicationDidEnterBackground(_ application: UIApplication) {
        self.window?.endEditing(true)
 }

Categories

...