Skip to content

Produkt/PDKTCollectionViewWaterfallLayout

Repository files navigation

Description

UICollectionViewLayout subclass to get the effect of Waterfall Layout (Popularized by Pinterest).

Sample

Sample Image Sample Image 2

Features

  • Multiple sections support
  • Every section can have its own number of columns
  • Section header and footer support
  • Easy configuration: Using properties or delegate protocol implementation
  • Automatic cell geometry calculation using aspect ratio instead of sizes

Usage

Simply add PDKTCollectionViewWaterfallLayout.h and PDKTCollectionViewWaterfallLayout.m files to your project and use it as your UICollectionViewLayout

If you are using Interface Builder to configure your Collection View, simply switch “Flow” to “Custom” at the Layout selector. Then set PDKTCollectionViewWaterfallLayout as your CollectionView Layout Class.

Interface Builder Config

Compatibility

  • PDKTCollectionViewWaterfallLayout is compatible with iOS6.0+
  • PDKTCollectionViewWaterfallLayout requires ARC.

Contributors

Special thanks to @caldofran for his contributions

License

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