Commit 8abc574c by Javier Heisekce

Agrega funciones de search bar

parent eb6c7e8a
...@@ -148,8 +148,25 @@ extension ContactsViewController: UITableViewDelegate, UITableViewDataSource { ...@@ -148,8 +148,25 @@ extension ContactsViewController: UITableViewDelegate, UITableViewDataSource {
extension ContactsViewController: UISearchBarDelegate, UISearchDisplayDelegate, UISearchResultsUpdating { extension ContactsViewController: UISearchBarDelegate, UISearchDisplayDelegate, UISearchResultsUpdating {
func updateSearchResults(for searchController: UISearchController) { func updateSearchResults(for searchController: UISearchController) {
<#code#>
}
func searchBarTextDidEndEditing(_ searchBar: UISearchBar) {
self.searchBar.showsCancelButton = false
} }
func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) {
self.searchBar.showsCancelButton = true
self.searchBar.resignFirstResponder()
}
func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
self.searchBar.text = ""
self.searchBarTextDidEndEditing(searchBar)
self.searchBar.resignFirstResponder()
}
func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
print(searchText)
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment