Always use stacked search bar placement on iPadOS 16

This commit is contained in:
Shadowfacts 2022-06-10 10:52:11 -04:00
parent 6ef8c92d09
commit 46fbbdc99a
1 changed files with 3 additions and 0 deletions

View File

@ -45,6 +45,9 @@ class SearchViewController: UIViewController {
navigationItem.searchController = searchController navigationItem.searchController = searchController
navigationItem.hidesSearchBarWhenScrolling = false navigationItem.hidesSearchBarWhenScrolling = false
if #available(iOS 16.0, *) {
navigationItem.preferredSearchBarPlacement = .stacked
}
} }
override func viewDidAppear(_ animated: Bool) { override func viewDidAppear(_ animated: Bool) {