Stripped-down version of sample code from "Advanced User Interfaces Using Collection View", WWDC 2014 Session 232