mralek / awpagedarray Goto Github PK
View Code? Open in Web Editor NEWA data structure for easier pagination. NSProxy subclass which acts as an NSArray for easier paging mechanisms in UITableViews and UICollectionViews.
License: MIT License
A data structure for easier pagination. NSProxy subclass which acts as an NSArray for easier paging mechanisms in UITableViews and UICollectionViews.
License: MIT License
When using paging data sources which don't have a fixed size, like a news feed, AWPagedArray should be able to dynamically increase its size as pages load.
remove please, just realized it doesn't needed :)
Hi and thank you for all this beautiful piece of code!
It would be nice to have an option to set the initial page because right now if you set it to 0 the setObjects: forPage: method, won't register the page.
Hello,
First of all, i appreciate all your work it's fantastic, and admire people like you who share their knowledge with the world.
I'm trying to implement your AWPagedArray, and i'm confused how to do it, since you've putted a usage example here in GitHub, but i feel it lacks a bit of information. I also downloaded the demo project, and over there i have some barriers about how to approach to it, and use it in my project.
Again i say, it could a problem for my side that i don't understand it, if you think it can be more explanatory and more easy approach, it would love that.
Thanks, and best of luck
As of now, this class doesn't work in Swift. Either I'll try to update the Objective-C code to work as is or I'll create an entire new collection type for paged arrays directly in Swift.
Thanks for putting AWPagedArray
together. It's pretty cool. My use case is to fetch data from a Parse backend, for which I don't know the count when I present the interface.
At present AWPagedArray
pretty much requires a fixed count to be available when the view loads, because it's a parameter of the initialiser -initWithCount:objectsPerPage:
.
What about the cases where the count is not known until display?
The comment pertaining to the dataObjects
array, which now reads...:
/**
* The array returned will be a proxy object containing
* NSNull values for data objects not yet loaded. As data
* loads, the proxy updates automatically to include
* the newly loaded objects.
*
* @see shouldLoadAutomatically
*/
...should instead read:
/**
* Each element in the array will contain an abstract data object (by proxy)
* as a placeholder for the requested, concrete data object via proxy.
* When the client requests any of the resources contained in a
* data object, the proxy will create a concrete instance of the
* data object, with which the array will replace the NSNull stored in
* the corresponding element.
*
* @see shouldLoadAutomatically
**/
...or, something like it, anyway. The proxy design pattern (and design patterns overall) were (and, to a large extent, still are) new to me; perfectly worded explanations are key to newbie success :)
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.