I'm adding a imageView and UISearchController.searchBar to tableView.tableHeaderView. but don't find the correct way to show the searchBar after the Image.
let view = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 333))
let image = UIImageView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 269))
image.image = #imageLiteral(resourceName: "map")
view.addSubview(image)
view.insertSubview(searchController.searchBar, at: 1)//insertSubview(searchController.searchBar, belowSubview: image)
self.tableView.tableHeaderView = view
Try giving search bar frame if you do not want to use autolayout