$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
答案 0 :(得分:5)
您需要在执行segue之前设置searchBar.active = false
。 (或prepareForSegue