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-06-03 18:46:31 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:49:48 +0300
commitf09f8296bb94a7484009655305233b794c3d76f0 (patch)
tree72b2ae40d337b633c40f94ec37bd8801a82aaca2 /iphone/Maps/Classes/MapsAppDelegate.mm
parenta1d2027f4ae7d3759d2a324f821368cf75f01241 (diff)
[ios] Fixed version check.
Diffstat (limited to 'iphone/Maps/Classes/MapsAppDelegate.mm')
-rw-r--r--iphone/Maps/Classes/MapsAppDelegate.mm29
1 files changed, 7 insertions, 22 deletions
diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm
index 01466d01a3..46aa02801c 100644
--- a/iphone/Maps/Classes/MapsAppDelegate.mm
+++ b/iphone/Maps/Classes/MapsAppDelegate.mm
@@ -213,7 +213,7 @@ void InitLocalizedStrings()
application.applicationIconBadgeNumber = f.GetCountryTree().GetActiveMapLayout().GetOutOfDateCount();
f.GetLocationState()->InvalidatePosition();
- if (isIOSVersionLessThan(7))
+ if (isIOSVersionLessThan(@"7"))
return [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey] != nil;
return [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
@@ -301,7 +301,7 @@ void InitLocalizedStrings()
m_mwmURL = nil;
m_fileURL = nil;
- if (!isIOSVersionLessThan(7))
+ if (!isIOSVersionLessThan(@"7"))
[FBSDKAppEvents activateApp];
[self restoreRouteState];
@@ -348,7 +348,7 @@ void InitLocalizedStrings()
attributes[UITextAttributeTextShadowColor] = [UIColor clearColor];
[[UINavigationBar appearanceWhenContainedIn:[NavigationController class], nil] setTintColor:[UIColor colorWithColorCode:@"15c584"]];
- if (!SYSTEM_VERSION_IS_LESS_THAN(@"7"))
+ if (!isIOSVersionLessThan(@"7"))
{
[[UIBarButtonItem appearance] setTitleTextAttributes:attributes forState:UIControlStateNormal];
@@ -376,7 +376,7 @@ void InitLocalizedStrings()
if ([self checkLaunchURL:url])
return YES;
- if (isIOSVersionLessThan(7))
+ if (isIOSVersionLessThan(@"7"))
return NO;
return [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
@@ -476,7 +476,7 @@ void InitLocalizedStrings()
- (void)trackWatchUser
{
- if (isIOSVersionLessThan(8))
+ if (isIOSVersionLessThan(@"8"))
return;
NSUserDefaults *standartDefaults = [NSUserDefaults standardUserDefaults];
@@ -545,7 +545,7 @@ void InitLocalizedStrings()
- (void)showFacebookAlert
{
- if (isIOSVersionLessThan(7) || !Reachability.reachabilityForInternetConnection.isReachable)
+ if (isIOSVersionLessThan(@"7") || !Reachability.reachabilityForInternetConnection.isReachable)
return;
UIViewController *topViewController = [(UINavigationController*)m_window.rootViewController visibleViewController];
@@ -632,27 +632,12 @@ void InitLocalizedStrings()
{
NSString *currentVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey];
NSString *firstVersion = [[NSUserDefaults standardUserDefaults] stringForKey:kUDFirstVersionKey];
- if (!firstVersion.length || [self version:currentVersion greaterThanVersion:firstVersion])
+ if (!firstVersion.length || firstVersionIsLessThanSecond(firstVersion, currentVersion))
return NO;
return YES;
}
-- (BOOL)version:(NSString *)first greaterThanVersion:(NSString *)second
-{
- NSArray *f = [first componentsSeparatedByString:@"."];
- NSArray *s = [second componentsSeparatedByString:@"."];
- NSUInteger iter = 0;
- while (f.count > iter && s.count > iter)
- {
- if ([(NSString*)f[iter] integerValue] == [(NSString*)s[iter] integerValue])
- iter++;
- else
- return [(NSString*)f[iter] integerValue] > [(NSString*)s[iter] integerValue];
- }
- return f.count > s.count;
-}
-
+ (NSInteger)daysBetweenNowAndDate:(NSDate*)fromDate
{
if (!fromDate)