ios8xcode6adaptive-ui

iOS8 adaptive UI: columns on iPad and rows on iPhone


How do I make use of "column"-based layout with adaptive UI in iOS8? What I want achieve is something like this on the iPad:

enter image description here

to look like this on the iPhone:

enter image description here

The size I can figure out but now how to actually make columns snap into rows like responsive web layout works. Any ideas?


Solution

  • You need to learn how install and uninstall constraints using size classes to achieve your layout changes. To change the scrolling direction you need to look at UITransitionCoordinator.

    There is a great chapter (5) about this exact topic in Raywenderlich's iOS 8 book. There is a color palette project which has a collection view that scrolls vertically in portrait and horizontal in landscape. The collectionViewCells also rotate as you rotate the device. Worth the buy!