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/MWMBookmarkColorViewController.mm
parent00c153b50ff6c92c312fb9fdc7662df4eef54388 (diff)
[ios] Added safety interface for work with metadata dictionary.
Diffstat (limited to 'iphone/Maps/Classes/MWMBookmarkColorViewController.mm')
-rw-r--r--iphone/Maps/Classes/MWMBookmarkColorViewController.mm37
1 files changed, 15 insertions, 22 deletions
diff --git a/iphone/Maps/Classes/MWMBookmarkColorViewController.mm b/iphone/Maps/Classes/MWMBookmarkColorViewController.mm
index bd795164d0..8f6f82cb3c 100644
--- a/iphone/Maps/Classes/MWMBookmarkColorViewController.mm
+++ b/iphone/Maps/Classes/MWMBookmarkColorViewController.mm
@@ -31,7 +31,7 @@ static NSString * const kBookmarkColorCellIdentifier = @"MWMBookmarkColorCell";
- (void)viewDidLoad
{
[super viewDidLoad];
- [self.ownerNavigationController setNavigationBarHidden:NO];
+ [self.iPadOwnerNavigationController setNavigationBarHidden:NO];
self.title = L(@"bookmark_color");
[self.tableView registerNib:[UINib nibWithNibName:kBookmarkColorCellIdentifier bundle:nil] forCellReuseIdentifier:kBookmarkColorCellIdentifier];
}
@@ -42,38 +42,32 @@ static NSString * const kBookmarkColorCellIdentifier = @"MWMBookmarkColorCell";
[self configureTableViewForOrientation:self.interfaceOrientation];
[self.tableView reloadData];
- if (!self.ownerNavigationController)
+ if (!self.iPadOwnerNavigationController)
return;
- self.realPlacePageHeight = self.ownerNavigationController.view.height;
+ self.realPlacePageHeight = self.iPadOwnerNavigationController.view.height;
CGFloat const bottomOffset = 88.;
- self.ownerNavigationController.view.height = self.tableView.height + bottomOffset;
+ self.iPadOwnerNavigationController.view.height = self.tableView.height + bottomOffset;
UIImage * backImage = [UIImage imageNamed:@"NavigationBarBackButton"];
UIButton * backButton = [[UIButton alloc] initWithFrame:CGRectMake(0., 0., backImage.size.width, backImage.size.height)];
- [backButton addTarget:self action:@selector(backTap:) forControlEvents:UIControlEventTouchUpInside];
+ [backButton addTarget:self action:@selector(backTap) forControlEvents:UIControlEventTouchUpInside];
[backButton setImage:backImage forState:UIControlStateNormal];
UIBarButtonItem * leftButton = [[UIBarButtonItem alloc] initWithCustomView:backButton];
[self.navigationItem setLeftBarButtonItem:leftButton];
}
-- (void)viewDidAppear:(BOOL)animated
-{
- [super viewDidAppear:animated];
-}
-
-- (void)backTap:(id)sender
+- (void)backTap
{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)configureTableViewForOrientation:(UIInterfaceOrientation)orientation
{
- if (self.ownerNavigationController)
+ if (self.iPadOwnerNavigationController)
return;
CGFloat const defaultHeight = 352.;
- CGSize size = self.navigationController.view.bounds.size;
- CGFloat width, height;
+ CGSize const size = self.navigationController.view.bounds.size;
switch (orientation)
{
@@ -84,8 +78,8 @@ static NSString * const kBookmarkColorCellIdentifier = @"MWMBookmarkColorCell";
case UIInterfaceOrientationPortrait:
{
CGFloat const topOffset = 88.;
- width = size.width < size.height ? size.width : size.height;
- height = size.width > size.height ? size.width : size.height;
+ CGFloat const width = size.width < size.height ? size.width : size.height;
+ CGFloat const height = size.width > size.height ? size.width : size.height;
CGFloat const externalHeight = self.navigationController.navigationBar.height + [[UIApplication sharedApplication] statusBarFrame].size.height;
CGFloat const actualHeight = defaultHeight > (height - externalHeight) ? height : defaultHeight;
self.tableView.frame = CGRectMake(0., topOffset, width, actualHeight);
@@ -96,8 +90,8 @@ static NSString * const kBookmarkColorCellIdentifier = @"MWMBookmarkColorCell";
case UIInterfaceOrientationLandscapeRight:
{
CGFloat const navBarHeight = self.navigationController.navigationBar.height;
- width = size.width > size.height ? size.width : size.height;
- height = size.width < size.height ? size.width : size.height;
+ CGFloat const width = size.width > size.height ? size.width : size.height;
+ CGFloat const height = size.width < size.height ? size.width : size.height;
CGFloat const currentHeight = height - navBarHeight;
CGFloat const actualHeight = currentHeight > defaultHeight ? defaultHeight : currentHeight;
self.tableView.frame = CGRectMake(0., navBarHeight, width, actualHeight);
@@ -121,12 +115,11 @@ static NSString * const kBookmarkColorCellIdentifier = @"MWMBookmarkColorCell";
[super viewWillDisappear:animated];
[self.placePageManager reloadBookmark];
- if (!self.ownerNavigationController)
+ if (!self.iPadOwnerNavigationController)
return;
- self.ownerNavigationController.navigationBar.hidden = YES;
- [self.ownerNavigationController setNavigationBarHidden:YES];
- self.ownerNavigationController.view.height = self.realPlacePageHeight;
+ [self.iPadOwnerNavigationController setNavigationBarHidden:YES];
+ self.iPadOwnerNavigationController.view.height = self.realPlacePageHeight;
}
@end