diff options
author | Igor Khmurets <subzero@mapswithme.com> | 2013-12-02 02:54:05 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:08:15 +0300 |
commit | 6498073d057ef9a680b86fd14246b7bef27af028 (patch) | |
tree | c1bf112ecd50790987cf56e800b38c9c569f3a04 /iphone/Maps/Classes/NavigationController.mm | |
parent | d3617aed6cc520af269b97c72bc92b7c044f8fdd (diff) |
[ios] Warnings fix
Diffstat (limited to 'iphone/Maps/Classes/NavigationController.mm')
-rw-r--r-- | iphone/Maps/Classes/NavigationController.mm | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/iphone/Maps/Classes/NavigationController.mm b/iphone/Maps/Classes/NavigationController.mm new file mode 100644 index 0000000000..3a47766120 --- /dev/null +++ b/iphone/Maps/Classes/NavigationController.mm @@ -0,0 +1,46 @@ + +#import "NavigationController.h" +#import "MapsAppDelegate.h" +#import "UIViewController+Navigation.h" +#import "MapViewController.h" + +@interface NavigationController () <UINavigationControllerDelegate> + +@end + +@implementation NavigationController + +- (UIStatusBarStyle)preferredStatusBarStyle +{ + return [self.viewControllers count] > 1 ? UIStatusBarStyleLightContent : UIStatusBarStyleDefault; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.delegate = self; +} + +- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated +{ + if ([viewController isMemberOfClass:[MapViewController class]]) + { + MapViewController * mapViewController = [MapsAppDelegate theApp].m_mapViewController; + [navigationController setNavigationBarHidden:![mapViewController shouldShowNavBar] animated:YES]; + } + else + { + [navigationController setNavigationBarHidden:NO animated:animated]; + } + if ([navigationController.viewControllers count] > 1) + [viewController showBackButton]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end |