@@ -38,37 +38,51 @@ class SearchViewController: InboxViewController {
3838
3939 override func setupNavigationBar( ) {
4040 title = " search_title " . localized
41- navigationItem. titleView = searchController. searchBar
4241 navigationItem. rightBarButtonItems = nil
4342 navigationItem. leftBarButtonItem = . defaultBackButton {
4443 self . navigationController? . popViewController ( animated: true )
4544 }
45+
46+ if #available( iOS 26 . 0 , * ) {
47+ navigationItem. searchController = searchController
48+ navigationItem. hidesSearchBarWhenScrolling = false
49+ } else {
50+ navigationItem. titleView = searchController. searchBar
51+ }
4652 }
4753
4854 private func setupSearch( ) {
4955 searchController. do {
5056 $0. delegate = self
5157 $0. searchResultsUpdater = self
5258 $0. hidesNavigationBarDuringPresentation = false
53- $0. searchBar. tintColor = . white
54- $0. searchBar. setImage ( UIImage ( systemName: " magnifyingglass " ) ? . tinted ( . white) , for: . search, state: . normal)
55- $0. searchBar. setImage ( UIImage ( systemName: " xmark " ) ? . tinted ( . white) , for: . clear, state: . normal)
5659 $0. searchBar. delegate = self
57- $0. searchBar. searchTextField. textColor = . white
5860 }
61+
62+ if #unavailable( iOS 26 . 0 ) {
63+ searchController. do {
64+ $0. searchBar. tintColor = . white
65+ $0. searchBar. setImage ( UIImage ( systemName: " magnifyingglass " ) ? . tinted ( . white) , for: . search, state: . normal)
66+ $0. searchBar. setImage ( UIImage ( systemName: " xmark " ) ? . tinted ( . white) , for: . clear, state: . normal)
67+ $0. searchBar. searchTextField. textColor = . white
68+ }
69+ }
70+
5971 update ( searchController: searchController)
6072 definesPresentationContext = true
6173 }
6274
6375 private func update( searchController: UISearchController ) {
64- searchController. searchBar. searchTextField. attributedPlaceholder = " search_placeholder "
65- . localized
66- . attributed (
67- . regular( 14 ) ,
68- color: UIColor . white. withAlphaComponent ( 0.7 ) ,
69- alignment: . left
70- )
71- searchController. searchBar. searchTextField. textColor = . white
76+ if #unavailable( iOS 26 . 0 ) {
77+ searchController. searchBar. searchTextField. attributedPlaceholder = " search_placeholder "
78+ . localized
79+ . attributed (
80+ . regular( 14 ) ,
81+ color: UIColor . white. withAlphaComponent ( 0.7 ) ,
82+ alignment: . left
83+ )
84+ searchController. searchBar. searchTextField. textColor = . white
85+ }
7286 searchController. searchBar. searchTextField. accessibilityIdentifier = " aid-search-all-emails-field "
7387 }
7488}
0 commit comments