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

'load more' functionality #4

Closed
gerardp opened this issue Apr 29, 2012 · 6 comments
Closed

'load more' functionality #4

gerardp opened this issue Apr 29, 2012 · 6 comments

Comments

@gerardp
Copy link

gerardp commented Apr 29, 2012

Please, add 'load more' functionality at the bottom of the table.

Thanks !

jmstone617 added a commit to jmstone617/SVPullToRefresh that referenced this issue May 1, 2012
@samvermette
Copy link
Owner

I will add this eventually. Note that it should be designed in a fashion similar to addPullToRefreshWithActionHandler: method. Something like: addInfiniteScrollingWithActionHandler:. Feel free to implement it yourself and submit a pull request.

@jmstone617
Copy link

I am working on integrating this into the SVPullToRefresh class, though I only get an hour here and there. I'll have something soon, and I'd love some feedback. Thanks a lot; this is my first contribution to GitHub, so I am still navigating my way around.

On May 3, 2012, at 4:22 PM, Sam Vermette wrote:

I will add this eventually. Note that it should be designed in a fashion similar to addPullToRefreshWithActionHandler: method. Something like: addInfiniteScrollingWithActionHandler:. Feel free to implement it yourself and submit a pull request.


Reply to this email directly or view it on GitHub:
#4 (comment)

@jmstone617
Copy link

I have it working now so that the user can drag past the last cell and trigger the load. I created a property in the SVPullToRefresh class that allows you to set either the section or row load limit. The SVPullToRefresh and the DragToLoad can be called with a single method - (void)addPullToRefreshWithActionHandler:andPerpetualLoadHandler:. In the Demo project, the only additional work is to tell your tableViewDelegate that the number of rows or sections should be the load limit times the number of loaded portions, which is a readonly property managed by SVPullToRefresh.

This is one implementation style. The other would be to automatically load the next portion of content once you scroll past a certain point in the scrollView/tableView. I can work on that implementation, as well. Perhaps by adding a third addPullToRefresh... method similar to addPullToRefreshWithActionHandler:automaticallyLoadNewContent:(BOOL)shouldLoadNewContent

@jmstone617
Copy link

I've renamed the perpetual load handler to -addPullToRefreshWithActionHandler:andDragToLoadHandler: to let you drag past the bottom of the scroll view to load more content. I've also added a "lazy" handler called - (void)addPullToRefreshWithActionHandler:infiniteScrollActionHandler: that will automatically fire the infiniteScrollingHandler once 80% of the scrollview's content is scrolled through. In SVPullToRefresh I have added a loadNextPortion method to SVPullToRefresh that will handle reloading your tableView or expanding your scrollView's contentSize automatically. Subsequently, you can leave this method call out (it is shown in the demo), and handle the loading action yourself.

@samvermette
Copy link
Owner

See my latest comment on pull request #10.

Will leave this issue open until someone else (or I) come up with a decent implementation of the "load more" functionality. Sorry if I sound rude, I'm just trying to keep SVPullToRefresh a high-quality component.

@samvermette
Copy link
Owner

I just added support for infinite scrolling. It might require a little more testing but seems to do the job pretty good so far. Will close the issue as the core functionality is there, but feel free to report bugs related to it though.

mingming1222 pushed a commit to mingming1222/SVPullToRefresh that referenced this issue Dec 22, 2016
Transfer pull request from origin repo
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

3 participants