I have a UITableView which has UISearchController (added programmatically). SearchController is added to header of TableView.(screenshot 2). However, I want to have a search view first in the middle of screen when app opens and after user starts to search, TableView appears and start to show datas.(screenshot 1)
I try to add UISearchBar inside Storyboard and connect it to UISearchController but can't assign it directly.
let searchController = UISearchController(searchResultsController: nil)
override func viewDidLoad() {
super.viewDidLoad()
// Setup the Search Controller
searchController.searchResultsUpdater = self
searchController.dimsBackgroundDuringPresentation = false
definesPresentationContext = true
mTableView.tableHeaderView = searchController.searchBar }