So if you’ve paid any attention to new iOS 6 stuff at all, you’ve probably noticed that this UICollectionView thing sounds remarkably interesting:
A collection view is a way to present an ordered set of data items using a flexible and changeable layout. The most common use for collection views is to present items in a grid-like arrangement, but collection views in iOS are capable of more than just rows and columns. With collection views, the precise layout of visual elements is definable through subclassing and can be changed dynamically. So you can implement grids, stacks, circular layouts, dynamically changing layouts, or any type of arrangement you can imagine…
Yeah? That kinda strains your credulousness a bit, doesn’t it? Let’s look for a second opinion, shall we?
The Awesomest UI Class I’ve Ever Seen
UICollectionView is spectacular. The combination of a clear interface and incredible flexibility make it an absolute masterpiece of API design. The UIKit engineers who designed it have truly outdone themselves. It is by far my favorite feature of the iOS 6 SDK. Make sure to watch WWDC sessions 205 and 219 if you haven’t yet seen them…
“Awesomest”. “Spectacular”. “Masterpiece”. Don’t hold back, tell us how you really feel. How about a third opinion? A fourth?
… Barely containing excitement. ) UICollectionView* stuff is Magic, pure Magic.
… UICollectionView is fucking awesome. It will change the face of iOS apps.
“Pure Magic”. “Fluffily Awesome”. Yes, a concrete degree of enthusiasm can be ascertained there as well. Anyone else?
UICollectionView is possibly the most important enhancement Apple has ever made to iOS’s base control set … Expect to see amazing new UIs in iOS 6 apps that do things with visual data presentation that were never possible before. Expect to see dynamic grids that can be resized, reordered, and visually transformed in imaginative ways…
Well, then. Looks like UICollectionView winds hands down the Industry Achievement Award for “Most Gushing Fanboism Ever Over a Flippin’ API”, indeed. Looks like it’s pretty safe to predict that there’s going to be a lot of people doing nifty stuff with it, and we might as well get a jump on that by collecting the first few introductions to it out of the box here:
First off, if you haven’t got it already, we thoroughly recommend you head over to chez Wenderlich and pick up the iOS 6 By Tutorials book; the two chapters on UICollectionView are worth the price alone if you haven’t been experimenting with it already, and hey there’s 25 other chapters bonus covering pretty much everything significant new there is.
Second off, rather than completely splitting your presentation layer code at iOS 6, you might wish to look into steipete / PSTCollectionView:
Open Source, 100% API compatible replacement of UICollectionView for iOS4.3+
You want to use UICollectionView, but still need to support iOS4/5? Then you’ll gonna love this project. I’ve originally written it for PSPDFKit, my iOS PDF framework that supports text selection and annotations, but this project seemed way to useful for others to to keep it for myself Plus, I would love the influx of new gridviews to stop. Better just write layout managers and build on a great codebase.
The goal is to use PSTCollectionView on iOS 4/5 as a fallback and switch to UICollectionView on iOS6. We even use certain runtime tricks to create UICollectionView at runtime for older versions of iOS. Ideally, you just link the files and everything works on older systems…
Ideally, yes. In practice, no doubt this is a good opportunity for collaboration by us all, yes? (h/t: ManiacDev)
It’s even there for people too cool to use Objective-C:
Xamarin: Introduction to CollectionViews
RubyMotion: RubyMotion gets iOS 6, iPhone 5, debugger
And here’s other intros and tips to get you started … which will no doubt become a longer list in the nearish future:
UICollectionView Example (h/t @romainbriche)
How to Use NSFetchedResultsController with UICollectionView (h/t ManiacDev)
UICollectionView Sample code for iOS 6
A simple UICollectionView tutorial
Example iOS Source Code Of A Customizable Coverflow Container Using UICollectionView
Beginning UICollectionView In iOS 6: Part 1/2 and Part 2/2
LXReorderableCollectionViewFlowLayout for iOS
Sticky Headers for UICollectionView using UICollectionViewFlowLayout
LXReorderableCollectionViewFlowLayout “Extends`UICollectionViewFlowLayout` to support reordering of cells.”
A Springboard-Like Layout With the UICollectionView Class
UICollectionViewWaterfallLayout “This layout is inspired by Pinterest. It also is compatible with PSTUICollectionView.”
How to Add a Decoration View to a UICollectionView
UICollectionView custom layout tutorial
Deleting cells from UICollectionView via NSNotification
Pinterest-style UICollectionViewLayout for UICollectionView
RFQuiltLayout “is a subclass of UICollectionViewLayout that positions various sized cells like a mason laying bricks.”
MSCollectionViewCalendarLayout ” is very similar to the “Week” view in the Apple Calendar/iCal app.”
UICollectionView Example with UICollectionViewFlowLayout
Workaround to vanilla UICollectionView+UICollectionViewFlowLayout using non-integral origins.
Custom iOS UICollectionViewLayout Modeled After The iCal App
Putting a UICollectionView in a UITableViewCell
mpospese / IntroducingCollectionViews has several samples from a conference talk.
How To Create A Rotating Image Wheel Using UICollectionView
Creating a Paged Photo Gallery With a UICollectionView
Open Source iOS Control For Easily Creating A Flowing Image Thumbnail Grid View
ASCollectionViewController “makes working with NSFetchedResultsController, UIMenuController and UIRefreshControl easier.”
Continue Reading →