SlideShare una empresa de Scribd logo
1 de 13
Descargar para leer sin conexión
RZCollectionList
Transforming and Displaying Data in TableViews and
                 CollectionViews



                                                Joe Goullaud
                                           joe@raizlabs.com
                                      ADN/Twitter: @jgoullaud
Overview
•   What does it do?

•   How does it help?

•   How do you use it?

•   ... and of course, Demo!
What is RZCollectionList?
A framework for encapsulating, combining, and
 transforming data from various sources and
displaying it in Collection-based Views on iOS.
RZCollectionList
                     RZCollectionList

      Source Lists                       Transform Lists

 RZArrayCollectionList             RZSortedCollectionList

RZFetchedCollectionList            RZFilteredCollectionList


               RZCompositeCollectionList

                     Combination Lists
RZCollectionListObserver
 collectionList:(id<RZCollectionList>)collectionList
didChangeObject:(id)object
    atIndexPath:(NSIndexPath*)indexPath
  forChangeType:(RZCollectionListChangeType)type
   newIndexPath:(NSIndexPath*)newIndexPath

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

collectionListWillChangeContent:(id<RZCollectionList>)collectionList

collectionListDidChangeContent:(id<RZCollectionList>)collectionList
RZCollectionList
         Data Sources
RZCollectionListTableViewDataSource


RZCollectionListCollectionViewDataSource

• Observe collection lists
• Automatically update views
Using RZCollectionList
NSFetchedResultsController



 RZFetchedCollectionList            UITableView



         RZCollectionListTableViewDataSource
3 OBJs and 1 IMP
NSFetchRequest *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
{
    ...
}
Transforming Lists
           RZArrayCollectionList



    RZCollectionListTableViewDataSource
Transforming Lists
          RZArrayCollectionList



         RZFilteredCollectionList



   RZCollectionListTableViewDataSource
Combining Lists
RZArrayCollectionList       RZFetchedCollectionList



            RZCompositeCollectionList



       RZCollectionListTableViewDataSource
DEMO
RZCollectionList Links
GitHub Project:
            http://github.com/Raizlabs/RZCollectionList


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


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

Más contenido relacionado

Destacado

Linkedin eindversie
Linkedin eindversieLinkedin eindversie
Linkedin eindversieBrandonMeeus
 
Thinking of investing with a Mutual?
Thinking of investing with a Mutual?Thinking of investing with a Mutual?
Thinking of investing with a Mutual?Scottish Friendly
 
Designed Sustainability1
Designed Sustainability1Designed Sustainability1
Designed Sustainability1Tim Hutchens
 
โครงการบรรเทาอุทกภัย
โครงการบรรเทาอุทกภัยโครงการบรรเทาอุทกภัย
โครงการบรรเทาอุทกภัยNattamonnew
 
Live fornowppt2 2
Live fornowppt2 2Live fornowppt2 2
Live fornowppt2 2ncabrera91
 
Djeca opkoljenog sarajeva nekad i sad
Djeca opkoljenog sarajeva nekad i sadDjeca opkoljenog sarajeva nekad i sad
Djeca opkoljenog sarajeva nekad i sadseanaseana
 
куприянова 3 дош.рукдулатова
куприянова 3 дош.рукдулатовакуприянова 3 дош.рукдулатова
куприянова 3 дош.рукдулатоваJopo4ka
 
Imtech ict linked in
Imtech ict linked inImtech ict linked in
Imtech ict linked ineprinsen
 
STL Amnesty Blogging - Aug. 2012
STL Amnesty Blogging - Aug. 2012STL Amnesty Blogging - Aug. 2012
STL Amnesty Blogging - Aug. 2012Allison Reilly
 

Destacado (15)

Linkedin eindversie
Linkedin eindversieLinkedin eindversie
Linkedin eindversie
 
Thinking of investing with a Mutual?
Thinking of investing with a Mutual?Thinking of investing with a Mutual?
Thinking of investing with a Mutual?
 
Lussier3e ch01.edit
Lussier3e ch01.editLussier3e ch01.edit
Lussier3e ch01.edit
 
Seminnde
SeminndeSeminnde
Seminnde
 
Designed Sustainability1
Designed Sustainability1Designed Sustainability1
Designed Sustainability1
 
Nota
NotaNota
Nota
 
โครงการบรรเทาอุทกภัย
โครงการบรรเทาอุทกภัยโครงการบรรเทาอุทกภัย
โครงการบรรเทาอุทกภัย
 
Live fornowppt2 2
Live fornowppt2 2Live fornowppt2 2
Live fornowppt2 2
 
Djeca opkoljenog sarajeva nekad i sad
Djeca opkoljenog sarajeva nekad i sadDjeca opkoljenog sarajeva nekad i sad
Djeca opkoljenog sarajeva nekad i sad
 
куприянова 3 дош.рукдулатова
куприянова 3 дош.рукдулатовакуприянова 3 дош.рукдулатова
куприянова 3 дош.рукдулатова
 
Imtech ict linked in
Imtech ict linked inImtech ict linked in
Imtech ict linked in
 
STL Amnesty Blogging - Aug. 2012
STL Amnesty Blogging - Aug. 2012STL Amnesty Blogging - Aug. 2012
STL Amnesty Blogging - Aug. 2012
 
Resp faq pg6
Resp faq pg6Resp faq pg6
Resp faq pg6
 
行动管理
行动管理行动管理
行动管理
 
Presentation3
Presentation3Presentation3
Presentation3
 

Better Table Views and Collection Views on iOS using RZCollectionList

  • 1. RZCollectionList Transforming and Displaying Data in TableViews and CollectionViews Joe Goullaud joe@raizlabs.com ADN/Twitter: @jgoullaud
  • 2. Overview • What does it do? • How does it help? • How do you use it? • ... and of course, Demo!
  • 3. What is RZCollectionList? A framework for encapsulating, combining, and transforming data from various sources and displaying it in Collection-based Views on iOS.
  • 4. RZCollectionList RZCollectionList Source Lists Transform Lists RZArrayCollectionList RZSortedCollectionList RZFetchedCollectionList RZFilteredCollectionList RZCompositeCollectionList Combination Lists
  • 5. RZCollectionListObserver collectionList:(id<RZCollectionList>)collectionList didChangeObject:(id)object atIndexPath:(NSIndexPath*)indexPath forChangeType:(RZCollectionListChangeType)type newIndexPath:(NSIndexPath*)newIndexPath collectionList:(id<RZCollectionList>)collectionList didChangeSection:(id<RZCollectionListSectionInfo>)sectionInfo atIndex:(NSUInteger)sectionIndex forChangeType:(RZCollectionListChangeType)type collectionListWillChangeContent:(id<RZCollectionList>)collectionList collectionListDidChangeContent:(id<RZCollectionList>)collectionList
  • 6. RZCollectionList Data Sources RZCollectionListTableViewDataSource RZCollectionListCollectionViewDataSource • Observe collection lists • Automatically update views
  • 7. Using RZCollectionList NSFetchedResultsController RZFetchedCollectionList UITableView RZCollectionListTableViewDataSource
  • 8. 3 OBJs and 1 IMP NSFetchRequest *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 { ... }
  • 9. Transforming Lists RZArrayCollectionList RZCollectionListTableViewDataSource
  • 10. Transforming Lists RZArrayCollectionList RZFilteredCollectionList RZCollectionListTableViewDataSource
  • 11. Combining Lists RZArrayCollectionList RZFetchedCollectionList RZCompositeCollectionList RZCollectionListTableViewDataSource
  • 12. DEMO
  • 13. RZCollectionList Links GitHub Project: http://github.com/Raizlabs/RZCollectionList Bugs and Feature Requests: http://github.com/Raizlabs/RZCollectionList/issues More iOS Frameworks & Components: http://raizlabs.github.com