Skip to content

a NSFetchedResultsController style controller for one-to-many relationship KVO Binding

License

Notifications You must be signed in to change notification settings

davidfuzju/SMBFetchedResultsController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SMBFetchedResultsController

[![CI Status](http://img.shields.io/travis/David Fu/SMBFetchedResultsController.svg?style=flat)](https://travis-ci.org/David Fu/SMBFetchedResultsController) Version License Platform

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Use it just like NSFetchedResultsController, set it up:

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.dataSource = [NSMutableOrderedSet orderedSetWithObject:[[Person alloc] initWithName:@"sherry"]];
    SMBFetchedResults *fetchedResults = [[SMBFetchedResults alloc] initWithMutableData:self.dataSource];
    self.fetchedResultsController = [[SMBFetchedResultsController alloc] initWithFetchedResults:fetchedResults title:@"SMB" delegate:self];
}

insert operation to SMBFetchedResults data struct:

- (IBAction)insertButtonClick:(id)sender {
    Person *person = [[Person alloc] initWithName:@"david"];
    [self.fetchedResultsController.fetchedResults insertObject:person inDataAtIndex:0];
}

that's it!

Requirements

Installation

SMBFetchedResultsController is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "SMBFetchedResultsController"

Author

David Fu, [email protected]

License

SMBFetchedResultsController is available under the MIT license. See the LICENSE file for more info.

About

a NSFetchedResultsController style controller for one-to-many relationship KVO Binding

Resources

License

Stars

Watchers

Forks

Packages

No packages published