diff --git a/ContactsApp/ContactsViewController.swift b/ContactsApp/ContactsViewController.swift index a25ce11..6876595 100644 --- a/ContactsApp/ContactsViewController.swift +++ b/ContactsApp/ContactsViewController.swift @@ -21,6 +21,7 @@ class ContactsViewController: UIViewController { super.viewDidLoad() contactsTable.register(UINib(nibName: "ContactSection", bundle: nil), forHeaderFooterViewReuseIdentifier: "headerId") importContacts() + searchBar.delegate = self contactsTable.tableFooterView = UIView(frame: .zero) searchBar.placeholder = NSLocalizedString("Nombre...", comment: "") } @@ -151,15 +152,6 @@ extension ContactsViewController: UISearchBarDelegate, UISearchDisplayDelegate, } - func searchBarTextDidEndEditing(_ searchBar: UISearchBar) { - self.searchBar.showsCancelButton = false - } - - func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) { - self.searchBar.showsCancelButton = true - self.searchBar.resignFirstResponder() - } - func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { print(searchText) }