VAR resultSearchController = UISearchController()
self.resultSearchController =({以下
let controller = UISearchController(searchResultsController: nil)
controller.searchResultsUpdater = self
controller.dimsBackgroundDuringPresentation = false
controller.searchBar.sizeToFit()
controller.searchBar.barTintColor = UIColor(red: 70/255,green: 70/255,blue: 71/255, alpha:0.9)
let textField = controller.searchBar.valueForKey("searchField") as! UITextField
textField.backgroundColor = UIColor(red: 16/255,green: 16/255,blue: 16/255, alpha:0.3)
controller.searchBar.tintColor = UIColor.lightGrayColor()
controller.hidesNavigationBarDuringPresentation = false
Segtable.tableHeaderView = controller.searchBar
controller.definesPresentationContext = true
controller.searchBar.delegate = self
controller.searchBar.barStyle = UIBarStyle.Black
return controller
})()
が
FUNCのupdateSearchResultsForSearchController(searchControllerデリゲートメソッドである:UISearchController) { }
これをtableViewsヘッダーに追加します。 – vikingosegundo