1

This line has caused compiler Warnings of searchDisplayController deprecation: as of Xcode 6.3 update.

ISSUE LINE if tableView == self.searchDisplayController!.searchResultsTableView

IN

func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    if tableView == self.searchDisplayController!.searchResultsTableView {return self.filteredPlayers.count}
    else {return self.results.count;}
}                 

I resolved this warning in other lines similar in format

func searchDisplayController(controller: UISearchDisplayController, shouldReloadTableForSearchScope searchOption: Int) -> Bool {
    let scope = self.searchDisplayController?.searchBar.scopeButtonTitles as! [String]
    self.filterContentForSearchText(self.searchDisplayController!.searchBar.text, scope: scope[searchOption])
    return true
}

by cutting out Display and removing searchDisplayController? from let scope = self.searchDisplayController?.searchBar.scopeButtonTitles line, as so

func searchController(controller: UISearchController, shouldReloadTableForSearchScope searchOption: Int) -> Bool {
    let scope = self.searchBar.scopeButtonTitles as! [String]
    self.filterContentForSearchText(self.searchBar.text, scope: scope[searchOption])
    return true
}

But I can't figure out the correct edit for the ISSUE LINE above.

if tableView == self.searchController!.searchResultsTableView  //could not find member 'searchResultsTableView'

and

if tableView == self.searchResultsTableView  //ViewController does not have a member named 'searchRsultsTableView'
Chameleon
  • 1,608
  • 3
  • 21
  • 39

1 Answers1

0

It looks like you can't do it from interface builder, but you have to do it from code instead.

Updating to the iOS 8 Search Controller

Individual11
  • 374
  • 4
  • 16