diff options
author | Ilya Grechuhin <i.grechuhin@mapswithme.com> | 2015-09-15 13:03:55 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:05:38 +0300 |
commit | f01fb281ec0848d1e7d87461a225b91f94a90f9c (patch) | |
tree | e92e21efd1a495d7a94cf3d17ba8b69fb431cfbc /iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.mm | |
parent | 2d97f262c20a4cf62b85232cd372edb03ac57b2e (diff) |
[ios] Changed initial tab selection logic.
Diffstat (limited to 'iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.mm')
-rw-r--r-- | iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.mm | 10 |
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 |