Chapter 7: Great at Any Angle: Collection Views and Auto Layout

Until now (before iOS 6), developers used UITableView for almost any type of display that shows a collection of items. Though Apple has been using a UI that looks similar to the collection views in photo apps for quite a long time (since the original iPhone), that UI wasn’t available for use by third-party developers. We depended on third-party frameworks like three20, or we hacked our own to display a collection list. For the most part they worked well, but implementing animation when items are added or deleted or implementing a custom layout like cover flow was difficult. Fret not. iOS 6 introduces a brand new controller for iOS just for displaying a collection of items. Collection view controllers are a completely new building block UI that’s similar to table view controllers. In this chapter, I introduce you to collection views in general, and you find out how to display a list of items using a collection view.

Later in this chapter, I introduce you to one of Cocoa’s features, Auto Layout. Auto Layout debuted for the Mac last year with Mac OS 10.7 SDK. Apple is introducing Auto Layout for iOS apps with iOS 6. In this chapter, you discover Auto Layout, focusing specifically on the layout options that are impossible to do now without writing code. I assume that you have experience customizing table views. If not, read Chapter 6 and then come back to this chapter. I also assume that you know the basics of storyboards ...

Get iOS 6 Programming Pushing the Limits: Advanced Application Development for Apple iPhone, iPad and iPod Touch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.