问题
I need to make the table view inside the UISearchDisplayController class to be a custom class which extends from UITableView
.
I'm using this pod: https://github.com/OliverLetterer/SLExpandableTableView, but I can't seem to make it work when using a UISearchBar and search results.
The class I want use for the table view it's called SLExpandableTableView
and it has several methods and properties which makes subrows work.
Thanks in advance.
回答1:
Not sure that's possible. I believe the problem is that UISearchDisplayController
instantiates an internal UITableView
for its results. You'd have to subclass and rewrite it to use your custom tableView, but I wouldn't recommend that.
In iOS 8, you can easily use your own (custom) tableView for search results, but it requires you to migrate to the newer UISearchController
.
来源:https://stackoverflow.com/questions/30330057/custom-class-for-uisearchdisplaycontrollers-table-view