1

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.

Felipe Peña
  • 2,712
  • 4
  • 22
  • 41
  • Are you using `UISearchDisplayController` because you need to support iOS 7? You also tagged `UISearchController` which is a replacement for `UISearchDisplayController`. –  May 19 '15 at 20:01
  • No, I'm using `UISearchDisplayController`. I will it remove that from tags. – Felipe Peña May 19 '15 at 20:04

1 Answers1

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.

  • Thanks! If I use `UISearchController` instead of `UISearchDisplayController`, can I support iOS 7 also? – Felipe Peña May 20 '15 at 23:03
  • No, you can't support iOS 7 and use `UISearchController`. And `UISearchDisplayController` doesn't support a custom tableView. I would say if it's a new app, to consider that `UISearchController` is the future, and Apple won't be working on `UISearchDisplayController`. But if you need to support iOS 7 and use a custom tableView, you can just use a `UISearchBar` and filter the search results on your own. –  May 21 '15 at 02:13