13
RZCollectionList Transforming and Displaying Data in TableViews and CollectionViews Joe Goullaud [email protected] ADN/Twitter: @jgoullaud

Better Table Views and Collection Views on iOS using RZCollectionList

Embed Size (px)

DESCRIPTION

A presentation given at CocoaHeads Boston on a framework for encapsulating, combining, and transforming data from various sources (Core Data, WebService, etc.) and easily displaying it in UITableViews and UICollectionViews on iOS.

Citation preview

Page 1: Better Table Views and Collection Views on iOS using RZCollectionList

RZCollectionListTransforming and Displaying Data in TableViews and

CollectionViews

Joe [email protected]

ADN/Twitter: @jgoullaud

Page 2: Better Table Views and Collection Views on iOS using RZCollectionList

Overview• What does it do?

• How does it help?

• How do you use it?

• ... and of course, Demo!

Page 3: Better Table Views and Collection Views on iOS using RZCollectionList

What is RZCollectionList?

A framework for encapsulating, combining, and transforming data from various sources and

displaying it in Collection-based Views on iOS.

Page 4: Better Table Views and Collection Views on iOS using RZCollectionList

RZCollectionList

RZCollectionList

RZArrayCollectionList

RZFetchedCollectionList

RZCompositeCollectionList

RZFilteredCollectionList

RZSortedCollectionList

Source Lists Transform Lists

Combination Lists

Page 5: Better Table Views and Collection Views on iOS using RZCollectionList

RZCollectionListObserver

collectionList:(id<RZCollectionList>)collectionListdidChangeObject:(id)object atIndexPath:(NSIndexPath*)indexPath forChangeType:(RZCollectionListChangeType)type newIndexPath:(NSIndexPath*)newIndexPath

collectionList:(id<RZCollectionList>)collectionListdidChangeSection:(id<RZCollectionListSectionInfo>)sectionInfo atIndex:(NSUInteger)sectionIndex forChangeType:(RZCollectionListChangeType)type

collectionListWillChangeContent:(id<RZCollectionList>)collectionList

collectionListDidChangeContent:(id<RZCollectionList>)collectionList

Page 6: Better Table Views and Collection Views on iOS using RZCollectionList

RZCollectionListData Sources

• Observe collection lists

• Automatically update views

RZCollectionListTableViewDataSource

RZCollectionListCollectionViewDataSource

Page 7: Better Table Views and Collection Views on iOS using RZCollectionList

NSFetchedResultsController

RZFetchedCollectionList UITableView

Using RZCollectionList

RZCollectionListTableViewDataSource

Page 8: Better Table Views and Collection Views on iOS using RZCollectionList

3 OBJs and 1 IMPNSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"ListItem" sortDescriptorKey:@"itemName" ascending:YES];

RZFetchedCollectionList *fetchedList = [[RZFetchedCollectionList alloc] initWithFetchRequest:request managedObjectContext:moc sectionNameKeyPath:@"subtitle" cacheName:nil]; RZCollectionListTableViewDataSource *listDataSource = [[RZCollectionListTableViewDataSource alloc] initWithTableView:tableView collectionList:fetchedList delegate:self];

...

- (UITableViewCell*)tableView:(UITableView *)tableView cellForObject:(id)object atIndexPath:(NSIndexPath *)indexPath{ ...}

Page 9: Better Table Views and Collection Views on iOS using RZCollectionList

RZArrayCollectionList

Transforming Lists

RZCollectionListTableViewDataSource

Page 10: Better Table Views and Collection Views on iOS using RZCollectionList

RZArrayCollectionList

Transforming Lists

RZCollectionListTableViewDataSource

RZFilteredCollectionList

Page 11: Better Table Views and Collection Views on iOS using RZCollectionList

RZArrayCollectionList

Combining Lists

RZFetchedCollectionList

RZCompositeCollectionList

RZCollectionListTableViewDataSource

Page 12: Better Table Views and Collection Views on iOS using RZCollectionList

DEMO

Page 13: Better Table Views and Collection Views on iOS using RZCollectionList

RZCollectionList Links

GitHub Project: http://github.com/Raizlabs/RZCollectionList

More iOS Frameworks & Components: http://raizlabs.github.com

Bugs and Feature Requests: http://github.com/Raizlabs/RZCollectionList/issues