nmondollot / nmpaginator Goto Github PK
View Code? Open in Web Editor NEWNMPaginator is a simple Objective-C class that handles pagination for you.
NMPaginator is a simple Objective-C class that handles pagination for you.
Hi, thanks a lot for your job but I wonder if you can explain me how to use your code with a web service from a php file?
I couldn't use the class FlickrPaginator,
//NMPaginator.m
//From:
[self.delegate paginator:self didReceiveResults:results];
//To:
if ([self respondsToSelector:@selector(paginator:didReceiveResults:)]) {
[self.delegate paginator:self didReceiveResults:results];
}
Hello,
This pagination class is loading (total + pageSize) so if your total is 50, 60 items are loaded. My service is returning the count as 50, but when scrolling and reaching 50 it shouldn't load any more but it does.
Looking through the code, you are using:
return self.page >= (NSInteger)((NSInteger)self.total / (NSInteger)self.pageSize) + 1;
Which if we look at:
total = 50
pageSize = 10
50 / 10 = 5 + 1 = 6
Which makes the class scroll up to 60 items not 50.
My solution is to use ceil when calculating this value:
if(self.total == 0) return NO;
return self.page >= ceil(self.total / self.pageSize);
Which should solve the problem. ceil(50 / 10) = 5. ceil(45 / 10) = 5
At least, this is how i do it.
Thanks alot for this great component
Hello,
Thanks for sharing your code.. Very useful...
Have a little request.. How can I integrate this library with a tableview that contains a searchBar with a scopeBar?.
My scopebar has 3 items and I want to allow my user to enter keywords.
Thanks for your support..
Regards
Can you open a setter for 'total'?
Some API implementations (for example built on top of MongoDB) don't return 'totalEntries' count in each request for entities and there is a separated request for count
so it needs a way to set 'total' independently
It seem NMPaginator support on iOS5.0+
Are there possible way to implement on iOS4.3+ ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.