Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question - How to implement infinite scroll?? #149

Open
jaySoftdev opened this issue Dec 19, 2019 · 1 comment
Open

Question - How to implement infinite scroll?? #149

jaySoftdev opened this issue Dec 19, 2019 · 1 comment

Comments

@jaySoftdev
Copy link

Is there any way we can implement infinite scroll for load more data? Let's say user inserts @joseph as a search, and there are more than 50 Joseph. So I want to implement infinite scroll for load more data when use scrolls the list.

@saalisumer
Copy link

saalisumer commented Oct 13, 2020

I was stuck with the same issue.
How I achieved this was keeping a reference of tableView in func cell(forMentionsEntity entity: HKWMentionsEntityProtocol!, withMatch matchString: String!, tableView: UITableView!, at indexPath: IndexPath!) -> UITableViewCell! method and observing its contentOffset property. And as user scrolls down and reaches the end of the list, make pagination calls and call completionBlock earlier stored from asyncRetrieveEntities function call. This isn't the best way, but a plausible solution. Things to be careful about is removing observer on tableview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants