From 9cf81e8003ad714cbf71001453ce491e8efbde76 Mon Sep 17 00:00:00 2001 From: Prabaharan Date: Mon, 20 Jun 2016 14:41:17 +0800 Subject: [PATCH] Fixed issue where the app is crashing when user taps on cancel button in search bar https://github.com/ipraba/EPContactsPicker/issues/14 --- Pods/EPContactsPicker.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Pods/EPContactsPicker.swift b/Pods/EPContactsPicker.swift index 73f6996..b756c26 100644 --- a/Pods/EPContactsPicker.swift +++ b/Pods/EPContactsPicker.swift @@ -317,17 +317,19 @@ public class EPContactsPicker: UITableViewController, UISearchResultsUpdating, U do { filteredContacts = try store.unifiedContactsMatchingPredicate(predicate, keysToFetch: allowedContactKeys()) - print("\(filteredContacts.count) count") + //print("\(filteredContacts.count) count") + self.tableView.reloadData() + } catch { - print("Handle the error please") + print("Error!") } } } public func searchBarCancelButtonClicked(searchBar: UISearchBar) { - searchBar.text = "" + dispatch_async(dispatch_get_main_queue(), { self.tableView.reloadData() })