Custom class for UISearchDisplayController's table view

a 夏天 提交于 2019-12-23 02:45:46

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!