Make selected textfield end editing when a save will occur (issue #203)

This commit is contained in:
James Hurst
2014-08-16 15:14:46 -04:00
parent be03656ce9
commit 7daf8ed879
3 changed files with 17 additions and 1 deletions

View File

@@ -125,7 +125,12 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(_didAddEntry:)
name:MPDocumentDidAddEntryNotification
object:document];
object:document];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(_willSave:)
name:MPDocumentWillSaveNotification
object:document];
}
- (void)dealloc {
@@ -439,4 +444,9 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
[self.titleTextField becomeFirstResponder];
}
- (void)_willSave:(NSNotification *)notification {
// Force selected textfield to end editing
[[[self view] window] makeFirstResponder:nil];
}
@end