TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Unclaimed.
UITableView data source based on NSFetchedResultsController.
NSFetchRequest * fetchRequest = [NSFetchRequest fetchRequestWithEntityName:@"Contact"];
// Configure the request's entity, and optionally its predicate.
NSSortDescriptor * sortByFirstLetter = [[NSSortDescriptor alloc] initWithKey:@"firstLetter"
ascending:YES
selector:@selector(localizedCaseInsensitiveCompare:)];
NSSortDescriptor * sortByName = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES];
[fetchRequest setSortDescriptors:@[sortByFirstLetter, sortByName]];
NSFetchedResultsController * controller = <#Fetched results controller#>
RITableDataSource * dataSource = [RITableDataSource dataSourceWithFetchedResultsController:controller];
[dataSource setReusableIdentifierBlock:^NSString *(NSIndexPath * indexPath) {
return <#Cell reusable identifier#>;
}];
[dataSource setConfigureCellBlock:^(UITableViewCell * cell, NSIndexPath * indexPath, id object) {
// Configurate cell here
}];
dataSource.tableView = self.tableView;
RITableDataSource requires Xcode 4.4 with either the iOS 5.0 SDK.
CocoaPods is the recommended way to add RITableDataSource to your project.
Here's an example podfile that installs RITableDataSource.
platform :ios, '5.0'
pod 'RITableDataSource'
RITableDataSource is available under the MIT license. See the LICENSE file for more info.