ios – Swift UIKit Searchbar Position


(https://i.stack.imgur.com/k8NuO.png)

(https://i.stack.imgur.com/si1oN.png)

The searchbar is created behind the navigationbar by default. It becomes visible when I scroll up.

override func viewDidLoad() {
super.viewDidLoad()
configureViewController()
configureSearchController()
configureCollectionView()
getFollowers(username: username, page: page)
configureDataSource()

    }

func configureSearchController() {
let searchController = UISearchController()
searchController.searchResultsUpdater = self
searchController.searchBar.delegate = self
searchController.searchBar.placeholder = "Search for a username"
searchController.obscuresBackgroundDuringPresentation = false
navigationItem.searchController = searchController

    }

Its not about navigationItem.hidesSearchBarWhenScrolling.

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img