Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hampusborgos/cpfquerycollectionviewcontroller
Read Parse.com queries directly into a collection view like with PFTableViewController.
https://github.com/hampusborgos/cpfquerycollectionviewcontroller
Last synced: 8 days ago
JSON representation
Read Parse.com queries directly into a collection view like with PFTableViewController.
- Host: GitHub
- URL: https://github.com/hampusborgos/cpfquerycollectionviewcontroller
- Owner: hampusborgos
- Created: 2012-10-08T11:24:00.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-10-15T07:32:11.000Z (about 11 years ago)
- Last Synced: 2024-04-15T02:52:18.087Z (7 months ago)
- Language: Objective-C
- Size: 11.9 MB
- Stars: 33
- Watchers: 8
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
`CPFQueryCollectionViewController` is a plug-in view controller than can be used like
`PFQueryTableViewController` but for collection views (`PFQueryCollectionViewController`
if you prefer).Installation
====It's enough to include `CPFQueryCollectionViewController.h / .m` in your project and
import them to start using it. Simply change your collection views to inherit from
`CPFQueryCollectionViewController` instead of the plain `UICollectionViewController`Usage
====Using the controller is very similar to Parse.coms table view controller.
https://parse.com/docs/ios/api/Classes/PFQueryTableViewController.html
You *must* overload `queryForCollection` to return a `PFQuery` that returns the objects you want
to display.You *must* overload `collectionView:cellForItemAtIndexPath:object:` to provide a your collection
view cells.You *may* overload `objectsWillLoad`, `objectsDidLoad` to hook into the pre and post loading of
the view. If you do, you must call [super objects\*Load] to get the proper behavior from the
loading indicator et. al.You can also override the usual `numberOfSectionsInCollectionView:`, `collectionView:numberOfItemsInSection:`
to tweak the order in which the items appear in the collection. Remember to also override `objectAtIndexPath:`
in this case.The initDefaults method allows you to disable pullToRefresh, enable pagination and to set the number of objects per page for when pagination is enabled.
What's Missing
====Using the view controller with template cells (ie. supplying `className` etc.
to the controller and let it handle the construction of the cells) is not yet supported. Constructing these
through Storyboards is so simple I did not feel it to be necessary.