I'm trying to figure out how to use UISearchController when you want to display the results in a separate searchResultsController - every single guide, video and tutorial I've found have all used the current viewController to present the search results, and instantiate UISearchController like so:
let searchController = UISearchController(searchResultsController: nil)
but I want to dim the view and present a new tableView with the search results, in the same way done on the App Store search. So what I've done is created a new tableViewController, given it a storyboard id, and then instantiated it like so:
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let resultsController = storyboard.instantiateViewController(withIdentifier: "searchResults") as! UITableViewController
let searchController = UISearchController(searchResultsController: resultsController )
which seems to work. However, I'm pretty stuck from here on out. I have no idea how to display the search results in the resultsController, what to put in cellForRowAtIndexPath in the resultsController and so on.
Any help is appreciated!