Closed georgepliuster closed 4 years ago
Hello @georgepliuster
Sorry for delayed response.
The usage of HitsTableViewController
is not mandatory, you can just add a conformance to HitsController
protocol to your own ViewController
and then connect it to your HitsInteractor
.
Pro tip: if your ViewController
presents the hits in the instance of UITableView
, add conformance to HitsTableViewContainer
protocol to your view controller, returning your table view via hitsTableView
property:
var hitsTableView: UITableView {
return myTableView
}
By doing this, you get the implementations of reload
and scrollToTop
methods of HitsController
protocol for free.
Hello Vladislav,
Good to hear from you. No worries about the delayed response.
Adding a conformance to the HitsController protocol is a great idea and I will give it a try.
Thanks!
On Wed, Aug 26, 2020 at 11:03 AM Vladislav Fitc notifications@github.com wrote:
Hello @georgepliuster https://github.com/georgepliuster
Sorry for delayed response. The usage of HitsTableViewController is not mandatory, you can just add a conformance to HitsController protocol to your own ViewController and then connect it to your HitsInteractor. Pro tip: if your ViewController presents the hits in the instance of UITableView, add conformance to HitsTableViewContainer protocol to your view controller, returning your table view via hitsTableView property:
var hitsTableView: UITableView { return myTableView }
By doing this, you get the implementations of reload and scrollToTop methods of HitsController protocol for free.
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/algolia/algoliasearch-client-swift/issues/653#issuecomment-680936571, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAL5EFW63ZMHGTKDLIZQ4HTSCUP2TANCNFSM4PT4TKLA .
You are welcome!
Describe the bug π I have an existing ViewController that uses TableViewDelegate, UITableViewDataSource with an array collection as a data source - a classical setup. I want to add a search bar and the inherit the HitTableViewController, allowing me to present my data either via the array collection or using the search bar. Depending on the mode of search (array or instant search) I will populate the table accordingly. Unfortunately the data source methods within the HitsTableViewController are declared public. Therefore I cannot override them in my inherited view controller. I tried extending my ViewController, but that does not work.
Aside from changing the data source method to open from public in the HitsTableViewController, do I have any other options?
Thanks
To Reproduce π Steps to reproduce the behavior:
Expected behavior π A clear and concise description of what you expected to happen.
Screenshots π₯ If applicable, add screenshots to help explain your problem.
Environment:
Additional context Add any other context about the problem here.