diff options
Diffstat (limited to 'iphone/Maps/Classes/CustomViews/MapViewControls/Search')
3 files changed, 11 insertions, 3 deletions
diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm index 9f6f5315a0..e723622d35 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm @@ -208,7 +208,7 @@ extern NSString * const kAlohalyticsTapEventKey; { [self endSearch]; GetFramework().GetCountryTree().GetActiveMapLayout().RemoveListener(m_mapsObserverSlotId); - self.tabbedController.selectedButtonTag = 0; + [self.tabbedController resetSelectedTab]; self.tableViewController = nil; self.downloadController = nil; self.rootView.isVisible = NO; diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.h b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.h index 3bd969e9a4..09076d503d 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.h +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.h @@ -7,8 +7,8 @@ @property (weak, nonatomic) NSLayoutConstraint * scrollIndicatorOffset; @property (weak, nonatomic) UIView * scrollIndicator; @property (weak, nonatomic) id<MWMSearchTabbedViewProtocol> delegate; -@property (nonatomic) NSInteger selectedButtonTag; - (void)tabButtonPressed:(MWMSearchTabButtonsView *)sender; +- (void)resetSelectedTab; @end 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 |