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

infiniteScrollTriggerOffset does not trigger unless you stop scrolling #58

Open
nothingimportant55 opened this issue Apr 28, 2017 · 2 comments

Comments

@nothingimportant55
Copy link

It seems that infiniteScrollTriggerOffset does not kick in and check to see if a new load should occur unless you pass the offset AND stop scrolling. For example, if you very slowly and steadily just scroll from the top of your UITableView until you reach the bottom, a load will not trigger when you cross the offset point, you must stop first. Is something perhaps running on the UI thread that shouldn't be?

Thanks!

@pronebird
Copy link
Owner

pronebird commented May 23, 2017

Hi,

If you do not pass an offset to infiniteScrollTriggerOffset then it's zero which is the same as the very bottom of your scroll view.

What you see happens because we schedule handler's execution using performSelector on default run loop. That has something to do with UITrackingRunLoopMode which delays default run loop approximately until table deceleration. At least visually deceleration coincides with when default run loop executes the selector. That's been pretty consistent across iOS versions.

The reason why it's done this way is to avoid interfering with user. Usually animations look smoother and interaction feels more natural when user does not play with table view. There are still glitches though, user may scroll the table after handler block fired causing undesired animations on reused cells.

We can try to replace performSelector with regular call and see if that causes any problems, but last time I checked that was still the case.

Reference: https://github.com/pronebird/UIScrollView-InfiniteScroll/blob/master/Classes/UIScrollView%2BInfiniteScroll.m#L459

@eclair4151
Copy link

i'm having the same issue. is there a way around this?

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

No branches or pull requests

3 participants