fix: find friend entry not present search scene issue

This commit is contained in:
CMK 2021-07-15 20:38:32 +08:00
parent 647f87744b
commit 2b19307e57
2 changed files with 14 additions and 3 deletions

View File

@ -316,7 +316,9 @@ extension HomeTimelineViewController {
}
@objc private func manuallySearchButtonPressed(_ sender: UIButton) {
coordinator.switchToTabBar(tab: .search)
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
let searchDetailViewModel = SearchDetailViewModel()
coordinator.present(scene: .searchDetail(viewModel: searchDetailViewModel), from: self, transition: .modal(animated: true, completion: nil))
}
@objc private func settingBarButtonItemPressed(_ sender: UIBarButtonItem) {

View File

@ -224,7 +224,10 @@ extension SearchDetailViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationController?.setNavigationBarHidden(false, animated: animated)
if navigationController?.viewControllers.count != 1 {
// set bar hidden but not when self is root
navigationController?.setNavigationBarHidden(false, animated: animated)
}
}
override func viewDidAppear(_ animated: Bool) {
@ -263,7 +266,13 @@ extension SearchDetailViewController: UISearchBarDelegate {
func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
logger.debug("\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public)")
navigationController?.popViewController(animated: false)
// dismiss or pop
if isModal {
dismiss(animated: true, completion: nil)
} else {
navigationController?.popViewController(animated: false)
}
}
}