How to always show searchBar when viewController is loaded in swift?

39 views Asked by At

I am trying to show searchBar always visible that is in the navigation bar. Below UISearchController there are tableView/collectionView with mutliple cells. Now searchBar is not shown always, rather it is shown after scrolling the collectionView.

SearchBar in the navigationBar is expected to show always

1

There are 1 answers

1
Mahi Al Jawad On BEST ANSWER

Try in Swift 5.2 or above

navigationItem.hidesSearchBarWhenScrolling = false