Skip to content

Commit 1763a8f

Browse files
committed
Change search to dismiss keyboard on "done" but not dismiss search results.
1 parent c9f98c6 commit 1763a8f

4 files changed

Lines changed: 7 additions & 9 deletions

File tree

SoundFontsFramework/SoundFontsFramework/Fonts, Presets, Tags/Fonts/FontsTableViewController.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,8 @@ extension FontsTableViewController {
7171
}
7272

7373
override func viewDidLayoutSubviews() {
74-
7574
if !isSearching && tableView.isDragging && tableView.contentOffset.y < -60 {
7675
beginSearch()
77-
return
7876
}
7977
}
8078

@@ -206,7 +204,7 @@ extension FontsTableViewController: UISearchBarDelegate {
206204

207205
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
208206
log.debug("searchBarSearchButtonClicked - \(searchBar.isFirstResponder)")
209-
endSearch()
207+
searchBar.resignFirstResponder()
210208
}
211209

212210
func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {

SoundFontsFramework/SoundFontsFramework/Fonts, Presets, Tags/Presets/PresetsTableViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ extension PresetsTableViewController: UISearchBarDelegate {
255255

256256
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
257257
log.debug("searchBarSearchButtonClicked - \(searchBar.isFirstResponder)")
258-
endSearch()
258+
searchBar.resignFirstResponder()
259259
}
260260

261261
func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {

SoundFontsFramework/SoundFontsFramework/UI/Views/FontsTableView.storyboard

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<searchBar key="tableHeaderView" contentMode="redraw" barStyle="black" searchBarStyle="minimal" placeholder="Name" showsCancelButton="YES" translucent="NO" id="E1M-c5-9UF" userLabel="Filter">
2020
<rect key="frame" x="0.0" y="0.0" width="414" height="64"/>
2121
<autoresizingMask key="autoresizingMask" widthSizable="YES"/>
22-
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" returnKeyType="done" smartDashesType="no" smartInsertDeleteType="no" smartQuotesType="no"/>
22+
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" returnKeyType="done" enablesReturnKeyAutomatically="YES" smartDashesType="no" smartInsertDeleteType="no" smartQuotesType="no"/>
2323
<scopeButtonTitles>
2424
<string>Title</string>
2525
<string>Title</string>

SoundFontsFramework/SoundFontsFramework/UI/Views/PresetsTableView.storyboard

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21225" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="boy-lS-5Eb">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="24506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="boy-lS-5Eb">
33
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21207"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24504"/>
77
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
88
</dependencies>
99
<scenes>
@@ -17,9 +17,9 @@
1717
<color key="backgroundColor" red="0.078431372550000003" green="0.078431372550000003" blue="0.078431372550000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
1818
<color key="sectionIndexColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
1919
<searchBar key="tableHeaderView" contentMode="redraw" barStyle="black" searchBarStyle="minimal" placeholder="Name" showsCancelButton="YES" translucent="NO" id="Qdk-w4-6Xp" userLabel="Filter">
20-
<rect key="frame" x="0.0" y="0.0" width="414" height="56"/>
20+
<rect key="frame" x="0.0" y="0.0" width="414" height="64"/>
2121
<autoresizingMask key="autoresizingMask" widthSizable="YES"/>
22-
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" returnKeyType="done" smartDashesType="no" smartInsertDeleteType="no" smartQuotesType="no"/>
22+
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" returnKeyType="done" enablesReturnKeyAutomatically="YES" smartDashesType="no" smartInsertDeleteType="no" smartQuotesType="no"/>
2323
<scopeButtonTitles>
2424
<string>Title</string>
2525
<string>Title</string>

0 commit comments

Comments
 (0)