gpt4 book ai didi

ios - 在 tableView cellForRow containsHit 方法之前访问 Algolia InstantSearch 命中

转载 作者:行者123 更新时间:2023-11-30 11:38:24 25 4
gpt4 key购买 nike

是否可以在此之前访问 InstantSearch 查询的命中
HitsCollectionViewDataSource 方法?

override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath, containing hit: [String : Any]) -> UITableViewCell 

我想先过滤掉某些点击,然后再将其呈现在 HitsTableWidget 中。

最佳答案

如果您想要对点击进行更多自定义,则必须进行更多的管道工作,并且无法使用 HitsCollectionViewDataSource

您应该使用 InstantSearch.shared.searcher 中提供的方法,特别是:InstantSearch.shared.searcher.addResultHandler(_:),它将帮助您指定每次新结果到达时都会调用的闭包。您所要做的就是使用这些搜索结果,过滤掉您想要的命中,然后手动重新加载 CollectionView

有关更多信息,请查看我们的指南 here关于使用 InstantSearchCore。如果您有任何反馈或更多问题,请随时提出!

关于ios - 在 tableView cellForRow containsHit 方法之前访问 Algolia InstantSearch 命中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49480610/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com