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,8 +224,11 @@ extension SearchDetailViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(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) {
super.viewDidAppear(animated)
@ -263,8 +266,14 @@ extension SearchDetailViewController: UISearchBarDelegate {
func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
logger.debug("\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public)")
// dismiss or pop
if isModal {
dismiss(animated: true, completion: nil)
} else {
navigationController?.popViewController(animated: false)
}
}
}