Upgrade to Pro — share decks privately, control downloads, hide ads and more …

UICollectionView

0ebf471a3ae8df42a84f93a7efbbdbd0?s=47 Ash Furrow
December 21, 2013

 UICollectionView

Talk I did for TACOW on the basics of UICollectionView.

0ebf471a3ae8df42a84f93a7efbbdbd0?s=128

Ash Furrow

December 21, 2013
Tweet

More Decks by Ash Furrow

Other Decks in Technology

Transcript

  1. UICollectionView Ash Furrow, Teehan+Lax

  2. None
  3. 1.UICollectionView is just like UITableView 2.UICollectionView separates layout from display

    3.UICollectionView makes complex layouts easy
  4. UICollectionView is just like UITableView... ! Except a little different.

  5. UITableView • UITableView is one of the mainstays of iOS

    • UICollectionView will be one for iOS 7
  6. Dequeuing Cells • UICollectionView works just like newer UITableView APIs

    • Register a class for a cell identifier • Later, dequeue a cell of that class for that identifier
  7. Demo

  8. UICollectionViewFlowLayoutDelegate • UICollectionView queries its delegate for info • Used

    to layout cells • Just like UITableViewDelegate
  9. Demo

  10. UICollectionView separates concerns. ! Layout, dequeuing, display

  11. UICollectionView Layouts • UICollectionView separates layout from dequeuing logic •

    UITableView encapsulates both • Allows us to easily customize layout of cells
  12. Demo

  13. Custom Layout Attributes • We can even define our own

    layout attributes
  14. Demo

  15. UICollectionView makes complex layouts easy... ! Or at least possible.

  16. UICollectionViewFlowLayout • Flow layouts provide a lot for you •

    Always try customizing them first
  17. UICollectionViewLayout • UICollectionViewLayout is an abstract class • Subclass it

    to go Hands On™ • Makes complex layouts easy
  18. Demo

  19. 1.UICollectionView is just like UITableView 2.UICollectionView separates layout from display

    3.UICollectionView makes complex layouts easy
  20. None
  21. Go buy my book

  22. Ash Furrow @ashfurrow Thanks!