From 5bfa9eede31e7873116fbfbca0cf17a0b00ab3fa Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Thu, 15 Sep 2022 10:13:05 +1000 Subject: [PATCH] ux: hide search bar cancel button when tapping on entering group name text field --- Session/Closed Groups/NewClosedGroupVC.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Session/Closed Groups/NewClosedGroupVC.swift b/Session/Closed Groups/NewClosedGroupVC.swift index 414363030..b468a56ee 100644 --- a/Session/Closed Groups/NewClosedGroupVC.swift +++ b/Session/Closed Groups/NewClosedGroupVC.swift @@ -213,10 +213,6 @@ final class NewClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegate } // MARK: - Interaction - - func textFieldDidEndEditing(_ textField: UITextField) { - crossfadeLabel.text = textField.text!.isEmpty ? NSLocalizedString("vc_create_closed_group_title", comment: "") : textField.text! - } fileprivate func tableViewWasTouched(_ tableView: TableView) { if nameTextField.isFirstResponder { @@ -313,8 +309,12 @@ extension NewClosedGroupVC: UISearchBarDelegate { return true } - func searchBarCancelButtonClicked(_ searchBar: UISearchBar) { + func searchBarShouldEndEditing(_ searchBar: UISearchBar) -> Bool { searchBar.showsCancelButton = false + return true + } + + func searchBarCancelButtonClicked(_ searchBar: UISearchBar) { searchBar.resignFirstResponder() } }