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:
Diffstat (limited to 'iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.mm')
-rw-r--r--iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.mm10
1 files changed, 9 insertions, 1 deletions
diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.mm
index 57162068fd..8149786a93 100644
--- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.mm
+++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.mm
@@ -6,6 +6,8 @@
#import "MWMSearchTabbedViewProtocol.h"
#import "UIKitCategories.h"
+#include "Framework.h"
+
static NSString * const kCollectionCell = @"MWMSearchTabbedCollectionViewCell";
typedef NS_ENUM(NSInteger, MWMSearchTabbedViewCell)
@@ -33,6 +35,7 @@ BOOL isOffsetInButton(CGFloat offset, MWMSearchTabButtonsView * button)
@property (nonatomic) MWMSearchCategoriesManager * categoriesManager;
@property (nonatomic) BOOL isRotating;
+@property (nonatomic) NSInteger selectedButtonTag;
@end
@@ -50,7 +53,12 @@ BOOL isOffsetInButton(CGFloat offset, MWMSearchTabButtonsView * button)
{
[super viewDidLoad];
[self setupCollectionView];
- self.selectedButtonTag = 0;
+ [self resetSelectedTab];
+}
+
+- (void)resetSelectedTab
+{
+ self.selectedButtonTag = GetFramework().GetLastSearchQueries().empty() ? 1 : 0;
}
- (void)viewWillAppear:(BOOL)animated