When launching UISearchController programatically the UISearchBar overlaps CollectionView below.
I've searched here and there and seems that no one had this kind of problem before.
There are some limitations on how i can and cannot do it:
- cannot use tableview header
- cannot use collectionview header
- have to use collectionviewcontroller
Already tried Adjust Scroll View Insets and Extend Edges - no use because its a CollectionViewController
The question is: how to do it the right way, using IBAction? The code for IBAction connected to the magnifying glass is:
@IBAction func showSearchBar(_ sender: UIBarButtonItem) {
let searchController = UISearchController(searchResultsController: nil)
searchController.searchResultsUpdater = self
searchController.dimsBackgroundDuringPresentation = false
present(searchController, animated: true, completion: nil)
}