在segue到新的ViewController之后,搜索栏不会消失

时间:2016-01-06 19:20:10

标签: ios iphone swift uisearchbar uisearchcontroller

$y = @{ $x };不希望在新的Search Bar之后消失。我创建了ViewController

search bar

对于来自 self.searchBar = UISearchController(searchResultsController: nil) self.searchBar.searchResultsUpdater = self self.searchBar.dimsBackgroundDuringPresentation = false self.navigationController?.extendedLayoutIncludesOpaqueBars = true self.tableView.tableHeaderView = self.searchBar.searchBar self.tableView.reloadData() 的segue到新View Controller我使用此函数:

TableViewController

此图片中的更多细节:

First TableController where I search data

Second ViewControler with SearchBar, which schould disaper, but it still exist

1 个答案:

答案 0 :(得分:5)

您需要在执行segue之前设置searchBar.active = false。 (或prepareForSegue