diff options
author | Ilya Grechuhin <i.grechuhin@mapswithme.com> | 2015-09-15 10:51:45 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:05:37 +0300 |
commit | 8201beb2faacdb133c59f37254556b9114429ac7 (patch) | |
tree | 3346c8a9bfdaf412ad50d2c9310f2915373aaa24 /iphone/Maps/Classes | |
parent | 5a9e92e87ceef2fd227a21672072596c8e53908c (diff) |
[ios] Added keyboard hide on return button.
Diffstat (limited to 'iphone/Maps/Classes')
-rw-r--r-- | iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm | 10 | ||||
-rw-r--r-- | iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.xib | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm index 619fac76c1..9f6f5315a0 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm @@ -15,7 +15,7 @@ extern NSString * const kAlohalyticsTapEventKey; @interface MWMSearchManager ()<MWMSearchTableViewProtocol, MWMSearchDownloadProtocol, MWMSearchTabbedViewProtocol, ActiveMapsObserverProtocol, - MWMSearchTabButtonsViewProtocol> + MWMSearchTabButtonsViewProtocol, UITextFieldDelegate> @property (weak, nonatomic) UIView * parentView; @property (nonatomic) IBOutlet MWMSearchView * rootView; @@ -127,6 +127,14 @@ extern NSString * const kAlohalyticsTapEventKey; [self.navigationController viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; } +#pragma mark - UITextFieldDelegate + +- (BOOL)textFieldShouldReturn:(nonnull UITextField *)textField +{ + [textField resignFirstResponder]; + return YES; +} + #pragma mark - MWMSearchTabbedViewProtocol - (void)searchText:(NSString *)text forInputLocale:(NSString *)locale diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.xib b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.xib index 4400c6d6de..8960bde3d7 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.xib +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.xib @@ -121,10 +121,11 @@ <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Search" adjustsFontSizeToFit="NO" minimumFontSize="17" clearButtonMode="always" translatesAutoresizingMaskIntoConstraints="NO" id="hna-zw-Zor" userLabel="Search" customClass="MWMSearchTextField"> <rect key="frame" x="8" y="4" width="246" height="36"/> <fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="14"/> - <textInputTraits key="textInputTraits" autocorrectionType="no" returnKeyType="search"/> + <textInputTraits key="textInputTraits" autocorrectionType="no" returnKeyType="done"/> <connections> <action selector="textFieldDidEndEditing:" destination="-1" eventType="editingDidEnd" id="1NS-lr-9DA"/> <action selector="textFieldTextDidChange:" destination="-1" eventType="editingChanged" id="lni-qP-88W"/> + <outlet property="delegate" destination="-1" id="1dg-Kn-jnV"/> </connections> </textField> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5Hu-71-uqb"> |