So I followed the instructions for the recommended way of adding a search view controller. Basically
let resultsController = storyboard.instantiateViewControllerWithIdentifier(SearchResultsViewController.storyboardIdentifier) as? SearchResultsViewController
let searchController = UISearchController(searchResultsController: resultsController)
searchController.searchResultsUpdater = resultsController
searchController.hidesNavigationBarDuringPresentation = false
searchController.searchBar.placeholder = NSLocalizedString("Enter keyword (e.g. iceland)", comment: "")
let searchContainer = UISearchContainerViewController(searchController: searchController)
self.navigationController?.pushViewController(searchContainer, animated: true)
And when it first loads the viewWillAppear()
of my resultsController
is called, but if I click a result and then press the menu button (to go back in the stack) viewWillAppear()
isn't called again. Is there anyway to capture that appearance event?