segueを実行すると、tableHeaderViewから検索バーを非表示にしたいと考えています。これどうやってするの?次のように私は、検索バーを作成します。別のビューに分割するときにUISearchControllerを非表示にする
override func viewDidLoad() {
...
resultSearchController = ({
let searchController = UISearchController(searchResultsController: nil) // The results of the search will be presented in the current Table View, so the searchResultsController parameter of the UISearchController init method is set to nil.
searchController.delegate = self
searchController.searchBar.delegate = self // Without this selectedScopeButtonIndexDidChange won't get called.
searchController.searchResultsUpdater = self
searchController.hidesNavigationBarDuringPresentation = true // NOTE: if false and tapping on a reminder to go the its details and then back then the titles may be screwed up.
searchController.dimsBackgroundDuringPresentation = false // NOTE: If true it would result in the filtered list not being scrollable.
searchController.hidesBottomBarWhenPushed = true
searchController.searchBar.sizeToFit()
self.definesPresentationContext = false
searchController.searchBar.scopeButtonTitles = SCOPEBAR_OPTIONS.descriptionArray
tableView.tableHeaderView = searchController.searchBar
return searchController
})()
私は単純に、このようなゼロに設定しようとしたが、運:メソッド
の下override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {
searchController.active = NO;
}