Bummer! This is just a preview. You need to be signed in with a Treehouse account to view the entire video.
Introducing UICollectionView0:56 with Sam Soffes
The UICollectionView class manages an ordered collection of data items and presents them using customizable layouts. Collection views provide the same general function as table views except that a collection view is able to support more than just single-column layouts.
For a long time all we had was TableView
for showing a collection of items, and it's great if
you want to show them in a list, but
for something other than a list it's not so great.
Thankfully, Apple added a more flexible way
IOS six called UICollectionView, and it's amazing.
You can show items every which way.
Something as simple as a grid, or even as complex as counter flow.
That's actually CollectionView's biggest strength, is how flexible its layouts are.
Let's take a minute, and see how all this works together.
CollectionView's pretty similar to UITableView.
You have a data source, delegate,section, cells, headers, footers.
Collection view does a lot of things similar to UITableView.
So this may be very familiar.
If you're not familiar with UITableView though, that's okay.
We'll go through it together.
You get a CollectionView cells to show on the screen.
You can then provide a layout to customize how it all gets displayed.
So you can make it look like this, this, or even this.
Let's dive in.
You need to sign up for Treehouse in order to download course files.Sign up