tvOS searchController viewWillAppear在导航回

时间:2016-06-10 16:53:21

标签: swift uiviewcontroller tvos viewwillappear

所以我按照建议的方式添加了一个搜索视图控制器。基本上

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)

当它第一次加载时,viewWillAppear()的{​​{1}}被调用,但如果我点击结果然后按菜单按钮(返回堆栈)resultsController isn&再次打来电话。无论如何都要捕获那个外观事件?

0 个答案:

没有答案