diff --git a/iphone/Maps/Bookmarks/PlacePageVC.mm b/iphone/Maps/Bookmarks/PlacePageVC.mm index 9a8a382df3..3ce71c6b53 100644 --- a/iphone/Maps/Bookmarks/PlacePageVC.mm +++ b/iphone/Maps/Bookmarks/PlacePageVC.mm @@ -140,7 +140,7 @@ if ([_pinTitle isEqualToString:NSLocalizedString(@"dropped_pin", nil)]) [[[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]].contentView viewWithTag:TEXTFIELD_TAG] becomeFirstResponder]; - if (isIPad) + if (IPAD) { CGSize size = CGSizeMake(320, 480); self.contentSizeForViewInPopover = size; @@ -321,7 +321,7 @@ - (void)pushToNavigationControllerAndSetControllerToPopoverSize:(UIViewController *)vc { - if (isIPad) + if (IPAD) [vc setContentSizeForViewInPopover:[self contentSizeForViewInPopover]]; [self.navigationController pushViewController:vc animated:YES]; } @@ -333,7 +333,7 @@ - (void)getSuperView:(double &)height width:(double &)width rect:(CGRect &)rect { - if (isIPhone) + if (!IPAD) { rect = [UIScreen mainScreen].bounds; height = self.view.window.frame.size.height; @@ -609,7 +609,7 @@ - (void)goToTheMap { GetFramework().GetBalloonManager().Hide(); - if (isIPad) + if (IPAD) [[MapsAppDelegate theApp].m_mapViewController dismissPopover]; else [self.navigationController popToRootViewControllerAnimated:YES]; @@ -712,12 +712,12 @@ [self.pickerView setBackgroundColor:[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.5]]; UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissPicker)]; [self.pickerView addGestureRecognizer:tap]; - if (isIPhone) + if (!IPAD) { [self.view endEditing:YES]; - UIWindow * window = APP.keyWindow; + UIWindow * window = [UIApplication sharedApplication].keyWindow; if (!window) - window = [APP.windows objectAtIndex:0]; + window = [[UIApplication sharedApplication].windows objectAtIndex:0]; [[[window subviews] objectAtIndex:0] addSubview:self.pickerView]; } else diff --git a/iphone/Maps/Bookmarks/SelectSetVC.mm b/iphone/Maps/Bookmarks/SelectSetVC.mm index 23f943f94d..466e232b44 100644 --- a/iphone/Maps/Bookmarks/SelectSetVC.mm +++ b/iphone/Maps/Bookmarks/SelectSetVC.mm @@ -1,6 +1,8 @@ + #import "SelectSetVC.h" #import "Framework.h" #import "AddSetVC.h" +#import "UIKitCategories.h" @implementation SelectSetVC @@ -66,7 +68,7 @@ if (indexPath.section == 0) { AddSetVC * asVC = [[AddSetVC alloc] initWithIndex:m_index]; - if (isIPad) + if (IPAD) [asVC setContentSizeForViewInPopover:[self contentSizeForViewInPopover]]; [self.navigationController pushViewController:asVC animated:YES]; } diff --git a/iphone/Maps/Classes/Common.h b/iphone/Maps/Classes/Common.h new file mode 100644 index 0000000000..042447c727 --- /dev/null +++ b/iphone/Maps/Classes/Common.h @@ -0,0 +1,10 @@ + +#define FIRST_LAUNCH_KEY @"FIRST_LAUNCH_KEY" + +#define MAPSWITHME_PREMIUM_APPSTORE_URL @"itms-apps://itunes.apple.com/app/id510623322" +#define MAPSWITHME_PREMIUM_LOCAL_URL @"mapswithmepro://" +#define MAPSWITHME_LITE_LOCAL_URL @"mapswithmelite://" + +#define BOOKMARK_CATEGORY_DELETED_NOTIFICATION @"BookmarkCategoryDeletedNotification" +#define METRICS_CHANGED_NOTIFICATION @"MetricsChangedNotification" +#define BOOKMARK_DELETED_NOTIFICATION @"BookmarkDeletedNotification" \ No newline at end of file diff --git a/iphone/Maps/Classes/Config.h b/iphone/Maps/Classes/Config.h deleted file mode 100644 index bbd1bd3b6b..0000000000 --- a/iphone/Maps/Classes/Config.h +++ /dev/null @@ -1,12 +0,0 @@ - - -#define isIPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) -#define isIPhone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) - -#define APP [UIApplication sharedApplication] - -#define FIRST_LAUNCH_KEY @"FIRST_LAUNCH_KEY" - -#define MAPSWITHME_PREMIUM_APPSTORE_URL @"itms-apps://itunes.apple.com/app/id510623322" -#define MAPSWITHME_PREMIUM_LOCAL_URL @"mapswithmepro://" -#define MAPSWITHME_LITE_LOCAL_URL @"mapswithmelite://" \ No newline at end of file diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index de8abd3ae8..eb846e790f 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -8,7 +8,6 @@ #import "UIKitCategories.h" #import "SettingsViewController.h" #import "UIViewController+Navigation.h" -#import "Config.h" #import "ShareActionSheet.h" #import "MPInterstitialAdController.h" #import "MPInterstitialViewController.h" @@ -958,7 +957,7 @@ const long long LITE_IDL = 431183278L; case FACEBOOK_ALERT_VIEW: { NSString * url = [NSString stringWithFormat:FACEBOOK_SCHEME]; - if (![APP canOpenURL: [NSURL URLWithString: url]]) + if (![[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString: url]]) url = [NSString stringWithFormat:FACEBOOK_URL]; [self manageAlert:buttonIndex andUrl:[NSURL URLWithString: url] andDlgSetting:dlg_settings::FacebookDlg]; return; @@ -1044,7 +1043,7 @@ NSInteger compareAddress(id l, id r, void * context) - (void)pushViewController:(UIViewController *)vc { - if (isIPad) + if (IPAD) { NavigationController * navC = [[NavigationController alloc] init]; self.popoverVC = [[UIPopoverController alloc] initWithContentViewController:navC]; @@ -1096,7 +1095,7 @@ NSInteger compareAddress(id l, id r, void * context) case 1: { dlg_settings::SaveResult(set, dlg_settings::OK); - [APP openURL: url]; + [[UIApplication sharedApplication] openURL:url]; break; } case 2: diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm index 01db6b0abe..3369146a2a 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.mm +++ b/iphone/Maps/Classes/MapsAppDelegate.mm @@ -6,7 +6,6 @@ #import "Statistics.h" #import "AarkiContact.h" #import -#import "Config.h" #import "UIKitCategories.h" #import "AppInfo.h" @@ -157,7 +156,8 @@ void InitLocalizedStrings() attributes[UITextAttributeTextColor] = [UIColor whiteColor]; attributes[UITextAttributeTextShadowColor] = [UIColor clearColor]; [[UINavigationBar appearance] setTintColor:[UIColor colorWithColorCode:@"393655"]]; - if (!SYSTEM_VERSION_IS_LESS_THAN(@"7")) { + if (!SYSTEM_VERSION_IS_LESS_THAN(@"7")) + { [[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]]; [[UIBarButtonItem appearance] setTitleTextAttributes:attributes forState:UIControlStateNormal]; diff --git a/iphone/Maps/Classes/PlacePreviewViewController.mm b/iphone/Maps/Classes/PlacePreviewViewController.mm index 59e559925b..2635f7c3ba 100644 --- a/iphone/Maps/Classes/PlacePreviewViewController.mm +++ b/iphone/Maps/Classes/PlacePreviewViewController.mm @@ -79,8 +79,8 @@ typedef enum {APIPOINT, POI, MYPOSITION} Type; - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - if (isIPad) - self.contentSizeForViewInPopover = CGSizeMake(320, 480);; + if (IPAD) + self.contentSizeForViewInPopover = CGSizeMake(320, 480); } #pragma mark - Table view data source diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 1e3dfe8dd3..87f057d137 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -1715,7 +1715,6 @@ ED48BBB917C2B1E2003E7E92 /* CircleView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CircleView.mm; sourceTree = ""; }; ED5D141B181AA8C900B51FB1 /* ic_guide_mark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_guide_mark.png; sourceTree = ""; }; ED5D141C181AA8C900B51FB1 /* ic_guide_mark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ic_guide_mark@2x.png"; sourceTree = ""; }; - ED7F47F917D47FD20016850C /* Config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Config.h; sourceTree = ""; }; ED8676FA16A0793800D9A02A /* 22x29-pro.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "22x29-pro.png"; sourceTree = ""; }; ED8676FB16A0793800D9A02A /* 44x58-pro.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "44x58-pro.png"; sourceTree = ""; }; ED8676FC16A0793800D9A02A /* 64-pro.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "64-pro.png"; sourceTree = ""; }; @@ -2502,7 +2501,7 @@ EDC5C542175F2CA600420E92 /* ShareActionSheet.mm */, ED48BBAF17BE6EA8003E7E92 /* MWMApi.h */, ED48BBB017BE6EA8003E7E92 /* MWMApi.mm */, - ED7F47F917D47FD20016850C /* Config.h */, + 97DEA09018D706C300C5F963 /* Common.h */, ); path = Classes; sourceTree = ""; diff --git a/iphone/Maps/Maps_Prefix.pch b/iphone/Maps/Maps_Prefix.pch index 8bb1153e3d..35ba44da37 100644 --- a/iphone/Maps/Maps_Prefix.pch +++ b/iphone/Maps/Maps_Prefix.pch @@ -2,7 +2,7 @@ // Prefix header for all source files of the 'Maps' target in the 'Maps' project // -#import "Config.h" +#import "Common.h" #ifdef __OBJC__ #import diff --git a/iphone/Maps/Settings/CountriesViewController.mm b/iphone/Maps/Settings/CountriesViewController.mm index 84b52b5fa8..f054a30363 100644 --- a/iphone/Maps/Settings/CountriesViewController.mm +++ b/iphone/Maps/Settings/CountriesViewController.mm @@ -7,6 +7,7 @@ #import "DiskFreeSpace.h" #import "Statistics.h" #import "Reachability.h" +#import "UIKitCategories.h" #include "Framework.h" @@ -286,14 +287,15 @@ static bool getGuideName(string & name, storage::TIndex const & index) NSURL * guideUrl = [NSURL URLWithString:[NSString stringWithUTF8String:info.GetAppID().c_str()]]; NSString * countryName = [NSString stringWithUTF8String:f.Storage().CountryName(m_clickedIndex).c_str()]; [[Statistics instance] logEvent:@"Open Guide Country" withParameters:@{@"Country Name" : countryName}]; - if ([APP canOpenURL:guideUrl]) + UIApplication * application = [UIApplication sharedApplication]; + if ([application canOpenURL:guideUrl]) { - [APP openURL:guideUrl]; + [application openURL:guideUrl]; [[Statistics instance] logEvent:@"Open Guide Button" withParameters:@{@"Guide downloaded" : @"YES"}]; } else { - [APP openURL:[NSURL URLWithString:[NSString stringWithUTF8String:info.GetURL().c_str()]]]; + [application openURL:[NSURL URLWithString:[NSString stringWithUTF8String:info.GetURL().c_str()]]]; [[Statistics instance] logEvent:@"Open Guide Button" withParameters:@{@"Guide downloaded" : @"NO"}]; } } @@ -495,7 +497,7 @@ static bool getGuideName(string & name, storage::TIndex const & index) [as addButtonWithTitle:[NSString stringWithUTF8String:guideAdevertiseString.c_str()]]; ++numOfButtons; } - if (isIPhone) + if (!IPAD) { [as addButtonWithTitle:NSLocalizedString(@"cancel", nil)]; as.cancelButtonIndex = numOfButtons; diff --git a/iphone/Maps/main.mm b/iphone/Maps/main.mm index 54326aa9ec..9148b86a19 100644 --- a/iphone/Maps/main.mm +++ b/iphone/Maps/main.mm @@ -1,7 +1,6 @@ #import #import #import -#import "Config.h" #include "../../platform/settings.hpp" #include "../../platform/platform.hpp"