UICollectionView sticky headers

10 Jan 2015

This post will explain how to mimic the 'sticky' behaviour of UITableView headers using a UICollectionView. To do this we'll implement a subclass of UICollectionViewFlowLayout that we will then use to tweak the position of header views as the content scrolls.

Read more...

UICollectionView layouts on wide iPhones

08 Jan 2015

It's not uncommon to use a UICollectionView to show a grid of items in a view and use Interface Builder to configure it's to fit a particular phone width. Unfortunately we no longer have a single phone width to worry about and if we use this static layout on a wider iPhone such as an iPhone 6, the standard behaviour of a UICollectionViewFlowLayout is to increase the spacing between the cells. What is often prefferable is for the collection view's cell size to grow, leaving the gap the same across different device sizes.

Read more...

iOS8 presentation controllers

29 Jun 2014

iOS 8 adds a new class, UIPresentationController, that works along-side the classes and protocols introduced in iOS 7 to help us implement custom view controller transitions. I always find it easier to understand a new API by working through an example, so let's build the following transition

Read more...

iOS7 interactive transitions

29 Sep 2013

iOS 7 introduces a new way to implement custom transitions between view controllers. This post and accompanying project shows how we can use custom transitions with a UINavigationController and how to make the pop transition interactive.

Read more...