From a41da5385205e2cf6fc733c2474e1bea2ffb1008 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Thu, 21 Apr 2016 13:40:58 +0300 Subject: [PATCH] [ios] Added return from map search to table search on text field activation. --- .../MapViewControls/Search/MWMSearchManager.mm | 10 +++++++++- .../MapViewControls/Search/MWMSearchView.xib | 16 +++------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm index bee828d13a..43713a4713 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm @@ -84,6 +84,12 @@ extern NSString * const kSearchStateKey = @"SearchStateKey"; #pragma mark - Actions +- (IBAction)textFieldDidBeginEditing:(UITextField *)textField +{ + if (self.state == MWMSearchManagerStateMapSearch) + self.state = MWMSearchManagerStateTableSearch; +} + - (IBAction)textFieldDidEndEditing:(UITextField *)textField { if (textField.text.length == 0) @@ -260,9 +266,11 @@ extern NSString * const kSearchStateKey = @"SearchStateKey"; - (void)changeToTableSearchState { + self.rootView.compact = NO; self.rootView.tabBarIsVisible = NO; self.tableViewController.searchOnMap = NO; - [self.navigationController pushViewController:self.tableViewController animated:NO]; + if (![self.navigationController.viewControllers containsObject:self.tableViewController]) + [self.navigationController pushViewController:self.tableViewController animated:NO]; } - (void)changeToMapSearchState diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.xib b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.xib index 63d9d9b1b2..68b060dc8a 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.xib +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.xib @@ -1,8 +1,8 @@ - + - + @@ -26,7 +26,6 @@ - @@ -37,7 +36,6 @@ - @@ -49,7 +47,6 @@ - @@ -61,7 +58,6 @@ - @@ -71,7 +67,6 @@ - @@ -104,7 +99,6 @@ - @@ -124,7 +118,6 @@ - @@ -135,7 +128,6 @@ - @@ -144,6 +136,7 @@ + @@ -151,7 +144,6 @@ - @@ -200,7 +191,6 @@ -