searchDisplayController, UITableView, Core Data and Swift

后端 未结 1 1512
天涯浪人
天涯浪人 2020-12-20 02:27

Trying to search in the table with searchDisplayController. Data filtering configured, the search dialog works. Now I want to work with a method prepareFo

相关标签:
1条回答
  • 2020-12-20 02:34

    self.tableView is the main table view, so the condition

    if self.tableView == self.searchDisplayController.searchResultsTableView
    

    will never be true. But you can check if the search is active or not:

    if self.searchDisplayController.active {
        // index path from search table ... 
    } else {
        // index path from main table ...
    }
    
    0 讨论(0)
提交回复
热议问题