I want to make my search bar stop scrolling along with table view. I tried to add search controller into viewForHeaderInSection and it failed.Also I want to try to show original content while search bar active. So I try to do it in viewDidLoad but I don't know how to make it work. Here is my code for both of method.
    searchController = UISearchController(searchResultsController: nil)
    searchController.hidesNavigationBarDuringPresentation = false
    searchController.searchBar.searchBarStyle = UISearchBarStyle.Prominent
    searchController.searchBar.sizeToFit()
    tableView.tableHeaderView = searchController.searchBar
    definesPresentationContext = true
    searchController.searchResultsUpdater = self
    searchController.dimsBackgroundDuringPresentation = false
Do you have any suggestion?