Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorv.mikhaylenko <v.mikhaylenko@corp.mail.ru>2015-06-16 20:21:32 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:52:40 +0300
commit4e8f1cc18f1a594e5cd35a7ee85937939ac3a4f2 (patch)
tree878b831909555983c98433dd0435e02b10b1787c /iphone/Maps/Classes/MWMPlacePageBookmarkCell.mm
parent00c153b50ff6c92c312fb9fdc7662df4eef54388 (diff)
[ios] Added safety interface for work with metadata dictionary.
Diffstat (limited to 'iphone/Maps/Classes/MWMPlacePageBookmarkCell.mm')
-rw-r--r--iphone/Maps/Classes/MWMPlacePageBookmarkCell.mm15
1 files changed, 9 insertions, 6 deletions
diff --git a/iphone/Maps/Classes/MWMPlacePageBookmarkCell.mm b/iphone/Maps/Classes/MWMPlacePageBookmarkCell.mm
index 43a30ab5db..aaceb1e828 100644
--- a/iphone/Maps/Classes/MWMPlacePageBookmarkCell.mm
+++ b/iphone/Maps/Classes/MWMPlacePageBookmarkCell.mm
@@ -49,21 +49,24 @@ extern NSString * const kBookmarkCellWebViewDidFinishLoadContetnNotification = @
{
NSDictionary const * info = [aNotification userInfo];
CGSize const kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
- [self.placePage willStartEditingBookmarkTitle:kbSize.height];
+ if ([self.title isEditing])
+ [self.placePage willStartEditingBookmarkTitle:kbSize.height];
}
- (void)keyboardWillBeHidden:(NSNotification *)aNotification
{
NSDictionary const * info = [aNotification userInfo];
CGSize const kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
- [self.placePage willFinishEditingBookmarkTitle:kbSize.height];
+ if ([self.title isEditing])
+ [self.placePage willFinishEditingBookmarkTitle:kbSize.height];
}
- (void)textFieldDidEndEditing:(UITextField *)textField
{
MWMPlacePageEntity * entity = self.placePage.manager.entity;
- entity.bookmarkTitle = textField.text;
+ entity.bookmarkTitle = textField.text.length > 0 ? textField.text : self.placePage.manager.entity.title;
[entity synchronize];
+ [textField resignFirstResponder];
}
- (BOOL)textFieldShouldClear:(UITextField *)textField
@@ -82,17 +85,17 @@ extern NSString * const kBookmarkCellWebViewDidFinishLoadContetnNotification = @
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
-- (IBAction)colorPickerButtonTap:(id)sender
+- (IBAction)colorPickerButtonTap
{
[self.placePage changeBookmarkColor];
}
-- (IBAction)categoryButtonTap:(id)sender
+- (IBAction)categoryButtonTap
{
[self.placePage changeBookmarkCategory];
}
-- (IBAction)editTap:(id)sender
+- (IBAction)editTap
{
[self.placePage changeBookmarkDescription];
}