2
0

Dismiss keyboard when dropping down preferences or app deactivates.

This commit is contained in:
Maarten Billemont 2017-04-30 18:54:07 -04:00
parent f83f2af529
commit b180202e07
2 changed files with 2 additions and 0 deletions

View File

@ -309,6 +309,7 @@ typedef NS_OPTIONS( NSUInteger, MPPasswordsTips ) {
PearlRemoveNotificationObservers(); PearlRemoveNotificationObservers();
PearlAddNotificationObserver( UIApplicationWillResignActiveNotification, nil, [NSOperationQueue mainQueue], PearlAddNotificationObserver( UIApplicationWillResignActiveNotification, nil, [NSOperationQueue mainQueue],
^(MPPasswordsViewController *self, NSNotification *note) { ^(MPPasswordsViewController *self, NSNotification *note) {
[self.view endEditing:YES];
self.passwordSelectionContainer.visible = NO; self.passwordSelectionContainer.visible = NO;
} ); } );
PearlAddNotificationObserver( UIApplicationDidBecomeActiveNotification, nil, [NSOperationQueue mainQueue], PearlAddNotificationObserver( UIApplicationDidBecomeActiveNotification, nil, [NSOperationQueue mainQueue],

View File

@ -38,6 +38,7 @@
metrics:nil views:NSDictionaryOfVariableBindings( popdownView )]; metrics:nil views:NSDictionaryOfVariableBindings( popdownView )];
[passwordsVC.popdownToTopConstraint layoutIfNeeded]; [passwordsVC.popdownToTopConstraint layoutIfNeeded];
[passwordsVC.view endEditing:YES];
[UIView animateWithDuration:0.6f delay:0 usingSpringWithDamping:0.75f initialSpringVelocity:1 [UIView animateWithDuration:0.6f delay:0 usingSpringWithDamping:0.75f initialSpringVelocity:1
options:UIViewAnimationOptionCurveEaseOut animations:^{ options:UIViewAnimationOptionCurveEaseOut animations:^{