I have the following SearchController:
class SearchController: UITableViewController, UISearchResultsUpdating
The implementation works well, but I have to tap on the search bar to start searching every time I load the controller. What I'd like is to activate the search bar once SearchController is loaded. I have tried with:
override func viewDidLoad() {
super.viewDidLoad()
...
...
self.resultSearchController.searchBar.becomeFirstResponder()
}
I also tried with:
override func viewDidAppear(animated: Bool) {
self.resultSearchController.searchBar.becomeFirstResponder()
}
But the search bar remains deactivated and the keyboard won't show up. What am I missing? Thanks!