There is a code that creates the Search Bar . After pressing this Search Bar , it is shifted down along with the "Cancel" button. I attach screenshots and code.
@IBAction func showSearchBar(_ sender: UIBarButtonItem) { self.navigationItem.setRightBarButtonItems([], animated: true) self.searchController = UISearchController(searchResultsController: nil) self.searchController.searchResultsUpdater = self self.searchController.searchBar.delegate = self self.searchController.delegate = self self.searchController.hidesNavigationBarDuringPresentation = false self.searchController.obscuresBackgroundDuringPresentation = true self.searchController.dimsBackgroundDuringPresentation = false self.searchController.searchBar.placeholder = "Искать продукты" self.searchController.searchBar.setShowsCancelButton(true, animated: true) self.searchController.searchBar.searchBarStyle = .minimal self.navigationItem.titleView = searchController.searchBar self.definesPresentationContext = true }
How to get rid of this bias?

