Skip to content

Commit

Permalink
Fixed Search controller section in example project
Browse files Browse the repository at this point in the history
Summary:
The search bar used to set the text as empty when the user scrolls.
Closes #922

Differential Revision: D5768667

Pulled By: rnystrom

fbshipit-source-id: 8a77708c2bd4101fbdef1401a1ad0d8d6e2fae7d
  • Loading branch information
RishabhTayal authored and facebook-github-bot committed Sep 5, 2017
1 parent bb983cf commit 3f7c7f3
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -46,14 +46,13 @@ final class SearchSectionController: ListSectionController, UISearchBarDelegate,
}

func searchBarTextDidEndEditing(_ searchBar: UISearchBar) {
delegate?.searchSectionController(self, didChangeText: "")
delegate?.searchSectionController(self, didChangeText: searchBar.text!)
}

// MARK: ListScrollDelegate

func listAdapter(_ listAdapter: ListAdapter, didScroll sectionController: ListSectionController) {
if let searchBar = (collectionContext?.cellForItem(at: 0, sectionController: self) as? SearchCell)?.searchBar {
searchBar.text = ""
searchBar.resignFirstResponder()
}
}
Expand Down

0 comments on commit 3f7c7f3

Please sign in to comment.