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:
authorIlya Grechuhin <i.grechuhin@mapswithme.com>2015-05-27 11:01:23 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:49:40 +0300
commit72740cd15dae576de1de90dc6f972e10b90994b2 (patch)
tree9c9d92d3cc37c8dbc94f37c6f40372e6b9250bec /iphone/Maps/Classes/MapsAppDelegate.mm
parentb9bd35435e1c87763afe9d5d3222b979a546cb7a (diff)
[ios] Restore active routing.
Diffstat (limited to 'iphone/Maps/Classes/MapsAppDelegate.mm')
-rw-r--r--iphone/Maps/Classes/MapsAppDelegate.mm21
1 files changed, 21 insertions, 0 deletions
diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm
index 2cc217cf50..01466d01a3 100644
--- a/iphone/Maps/Classes/MapsAppDelegate.mm
+++ b/iphone/Maps/Classes/MapsAppDelegate.mm
@@ -10,6 +10,7 @@
#import "Reachability.h"
#import "MWMWatchEventInfo.h"
#import "Common.h"
+#import "RouteState.h"
#include <sys/xattr.h>
@@ -240,6 +241,11 @@ void InitLocalizedStrings()
}
}
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+ [RouteState save];
+}
+
- (void)applicationWillEnterForeground:(UIApplication *)application
{
[self.m_locationManager orientationChanged];
@@ -297,6 +303,8 @@ void InitLocalizedStrings()
if (!isIOSVersionLessThan(7))
[FBSDKAppEvents activateApp];
+
+ [self restoreRouteState];
}
- (void)dealloc
@@ -491,6 +499,19 @@ void InitLocalizedStrings()
}
}
+#pragma mark - Route state
+
+- (void)restoreRouteState
+{
+ if (GetFramework().IsRoutingActive())
+ return;
+ RouteState const * const state = [RouteState savedState];
+ if (state.hasActualRoute)
+ self.m_mapViewController.restoreRouteDestination = state.endPoint;
+ else
+ [RouteState remove];
+}
+
#pragma mark - Alert logic
- (void)firstLaunchSetup