Latest 1.0.4
Homepage https://github.com/jozsef-vesza/JVRCoreDataCollectionViewDataSource
License MIT
Platforms ios 5.0, requires ARC
Dependencies JVRCellConfiguratorDelegate
Frameworks CoreData
Authors

 JVRCoreDataCollectionViewDataSource

JVRCoreDataCollectionViewDataSource aims to make your collection view controllers lighter by encapsulating logic from NSFetchedResultsControllerDelegate and UICollectionViewDataSource.

Usage

Using JVRCoreDataCollectionViewDataSource is really simple, you only need a few lines in your view collection controller class.


@interface MyViewController()
@property (nonatomic, strong) JVRCoreDataCollectionViewDataSource *dataSource;
@end

@implementation MyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.dataSource = [JVRCoreDataCollectionViewDataSource dataSourceForCollectionView:self.collectionView 
                                                          withFetchedResultsController:self.fetchedResultsController
                                                                  withCellConfigurator:[[MyCellConfigurator alloc] init]];
    }

@end

As you might have noticed, you will also need a cell configurator class (MyCellConfigurator in this example), which has to implement the methods of the JVRCellConfiguratorDelegate protocol. See the project page for details about how to do this.

Installation

CocoaPods is a great way to add third party libraries to your project so I recommend using it for JVRCoreDataCollectionViewDataSource as well. Add the following line to your Podfile:

  pod 'JVRCoreDataCollectionViewDataSource'

This will also add the previously mentioned JVRCellConfiguratorDelegate as dependency.

Latest podspec

{
    "name": "JVRCoreDataCollectionViewDataSource",
    "version": "1.0.4",
    "summary": "A reusable class that combines UICollectionViewDataSource and NSFetchedResultsControllerDelegate.",
    "homepage": "https://github.com/jozsef-vesza/JVRCoreDataCollectionViewDataSource",
    "license": "MIT",
    "authors": {
        "Ju00f3zsef Vesza": "[email protected]"
    },
    "social_media_url": "http://twitter.com/j_vesza",
    "platforms": {
        "ios": "5.0"
    },
    "source": {
        "git": "https://github.com/jozsef-vesza/JVRCoreDataCollectionViewDataSource.git",
        "tag": "1.0.4"
    },
    "source_files": "*.{h,m}",
    "public_header_files": "*.h",
    "frameworks": "CoreData",
    "requires_arc": true,
    "dependencies": {
        "JVRCellConfiguratorDelegate": []
    }
}

Pin It on Pinterest

Share This