5

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?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • I create a subclass of UISearchContainerViewController and viewWillAppear get called for subclass of UISearchContainerViewController – V V Feb 06 '20 at 21:33

0 Answers0