I am doing it programmatically. I also tried to set it into TitleView, but it's not working. Code below:
//searchBar
let searchController = UISearchController(searchResultsController: nil)
searchController.searchResultsUpdater = self
searchController.obscuresBackgroundDuringPresentation = false
searchController.searchBar.placeholder = "Search Players"
navigationItem.searchController = searchController
navigationItem.hidesSearchBarWhenScrolling = false
definesPresentationContext = true
I also have a ScopeBar under the searchBar, when selected. If I do it like:
searchController.titleView = searchController.searchBar
It goes in place, but I cannot select/tap the searchBar anymore.

For me, your example works well, but maybe you canuse it.
You can insert search bar into navigation like here. Can you explain what's wrong with search bar in table view header? What isn't work?