diff options
author | VladiMihaylenko <vxmihaylenko@gmail.com> | 2015-04-17 18:48:43 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:52:38 +0300 |
commit | 9d2141ae12860ba6f587c97ca31d3986be2a4b51 (patch) | |
tree | 6bf88c44032eb0cdb9adea1698d355b43f30e44e /iphone/Maps/Classes/MWMPlacePageNavigationBar.mm | |
parent | 628476581b9783b865eeda3ba8a274bfc8086f98 (diff) |
[ios] iPhone landscape placepage
Diffstat (limited to 'iphone/Maps/Classes/MWMPlacePageNavigationBar.mm')
-rw-r--r-- | iphone/Maps/Classes/MWMPlacePageNavigationBar.mm | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/iphone/Maps/Classes/MWMPlacePageNavigationBar.mm b/iphone/Maps/Classes/MWMPlacePageNavigationBar.mm new file mode 100644 index 0000000000..e6a573aa6e --- /dev/null +++ b/iphone/Maps/Classes/MWMPlacePageNavigationBar.mm @@ -0,0 +1,49 @@ +// +// MWMPlacePageNavigationBar.m +// Maps +// +// Created by v.mikhaylenko on 13.05.15. +// Copyright (c) 2015 MapsWithMe. All rights reserved. +// + +#import "MWMPlacePageNavigationBar.h" +#import "MWMiPhonePortraitPlacePageView.h" +#import "MWMPlacePageViewManager.h" +#import "UIKitCategories.h" + +static NSString * const kPlacePageNavigationBarNibName = @"PlacePageNavigationBar"; + +@interface MWMPlacePageNavigationBar () + +@property (weak, nonatomic, readwrite) IBOutlet UILabel *titleLabel; +@property (weak, nonatomic) MWMiPhonePortraitPlacePageView *placePage; + +@end + +@implementation MWMPlacePageNavigationBar + ++ (instancetype)navigationBarWithPlacePage:(MWMiPhonePortraitPlacePageView *)placePage +{ + MWMPlacePageNavigationBar *navBar = [[[NSBundle mainBundle] loadNibNamed:kPlacePageNavigationBarNibName owner:nil options:nil] firstObject]; + navBar.placePage = placePage; + navBar.width = placePage.bounds.size.width; + navBar.titleLabel.text = placePage.titleLabel.text; + navBar.center = CGPointMake(placePage.superview.origin.x + navBar.width / 2., placePage.superview.origin.y - navBar.height / 2.); + [placePage.superview addSubview:navBar]; + return navBar; +} + +- (IBAction)backTap:(id)sender +{ + [self.placePage.placePageManager dismissPlacePage]; + [UIView animateWithDuration:.3 animations:^ + { + self.transform = CGAffineTransformMakeTranslation(0., -self.height); + } + completion:^(BOOL finished) + { + [self removeFromSuperview]; + }]; +} + +@end |