Latest 0.2.2
License MIT
Platforms ios 8.0, requires ARC

Pinterest inspired layout for UICollectionViews

Note: Updated for Swift 2.0 and cocoapods

CollectionViewWaterfallLayout is a subclass of UICollectionViewLayout written completely in Swift. This class is based off CHTCollectionViewWaterfallLayout which was written by chiahsien in Objective C. This class tries to use as many new Swifty things to keep the code updated with current design patterns.

The original layout was inspired by Pinterest.


  • Easy to use – If you are used to working with UICollectionViewFlowLayout, this should feel natural
  • Highly Customizable
  • Outstanding Performance
  • Supports headers and footers

Screen Shots

Real World Example
Demo Example


  • ARC
  • iOS 7+
  • Xcode 7+
  • Swift 2.0


CollectionViewWaterfallLayout is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "CollectionViewWaterfallLayout"

How to Use

Check out the demo project for an example using storyboards to set up the views, and that programmatically creates and customizes the waterfall layout.

Customizable Properties

Below are the public properties and their default values that you can change to customize the layout

var columnCount:Int = 2
var minimumColumnSpacing:Float = 10.0
var minimumInteritemSpacing:Float = 10.0
var headerHeight:Float = 0.0
var footerHeight:Float = 0.0
var headerInset:UIEdgeInsets = UIEdgeInsetsZero
var footerInset:UIEdgeInsets = UIEdgeInsetsZero
var sectionInset:UIEdgeInsets = UIEdgeInsetsZero

Required Protocol

Your collection view’s delegate must conforms to CollectionViewWaterfallLayoutDelegate protocol and implement the required method, all you need to do is return the original size of the item:

func collectionView(collectionView: UICollectionView, layout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize


  • Only vertical scrolling is supported.
  • No decoration view.


CollectionViewWaterfallLayout is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "CollectionViewWaterfallLayout",
    "version": "0.2.2",
    "summary": "Pinterest inspired layout for UICollectionViews written in Swift",
    "homepage": "",
    "screenshots": [
    "license": "MIT",
    "authors": "Eric Cerney",
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "source": {
        "git": "",
        "tag": "v0.2.2"
    "source_files": "CollectionViewWaterfallLayout.swift",
    "requires_arc": true

Pin It on Pinterest

Share This