better logic for dismiss searchController

This commit is contained in:
nixzhu
2015-08-19 13:27:35 +08:00
parent b0e463628b
commit 2a5023fdfd
@@ -165,11 +165,7 @@ extension ContactsViewController: UITableViewDataSource, UITableViewDelegate {
if let friend = friendAtIndexPath(indexPath) {
if searchControllerIsActive {
dismissViewControllerAnimated(true) { [weak self] in
self?.searchController?.searchBar.text = ""
}
}
searchController?.active = false
performSegueWithIdentifier("showProfile", sender: friend)
}