mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-26 05:18:31 -04:00
hide search bar when show search
This commit is contained in:
parent
fdeb7bf39d
commit
fcf6fc46a4
@ -81,6 +81,8 @@ extension MainController: SearchBarDelegate, SearchContainerDelegate {
|
||||
controller.delegate = self
|
||||
guard !childViewControllers.contains(controller) else {return}
|
||||
|
||||
navigationController?.setToolbarHidden(true, animated: animated)
|
||||
|
||||
// add cancel button if needed
|
||||
if traitCollection.horizontalSizeClass == .compact {
|
||||
navigationItem.setRightBarButton(buttons.cancel, animated: animated)
|
||||
@ -111,6 +113,8 @@ extension MainController: SearchBarDelegate, SearchContainerDelegate {
|
||||
private func hideSearch(animated: Bool) {
|
||||
guard let searchController = childViewControllers.flatMap({$0 as? SearchContainer}).first else {return}
|
||||
|
||||
navigationController?.setToolbarHidden(false, animated: animated)
|
||||
|
||||
// remove cancel button if needed
|
||||
if traitCollection.horizontalSizeClass == .compact {
|
||||
navigationItem.setRightBarButton(nil, animated: animated)
|
||||
|
Loading…
x
Reference in New Issue
Block a user