Giter VIP home page Giter VIP logo

nmpaginator's People

Contributors

hydex86 avatar nmondollot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nmpaginator's Issues

reachedLastPage calculation is wrong

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

Request : SearchBar with ScopeBar

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

Open setter for 'total'

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

iOS version support?

It seem NMPaginator support on iOS5.0+

Are there possible way to implement on iOS4.3+ ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.