1
Search Bar
不希望在延續到新的ViewController
後消失。我創建search bar
這樣做:搜索欄不會消失後,繼續到新的ViewController
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()
從TableViewController
SEGUE新View Controller
我用這個函數:
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
self.performSegueWithIdentifier("ContentViewCOntroller", sender: self)
}
更多細節在這個圖片:
First TableController where I search data
Second ViewControler with SearchBar, which schould disaper, but it still exist