CHTCollectionViewWaterfallLayout is a UICollectionViewLayout subclass that implements a waterfall layout for collection views, inspired by Pinterest's design pattern.
The tool solves the problem of displaying items in a multi-column layout where each column fills independently, creating a staggered appearance rather than a grid. It works by subclassing UICollectionViewLayout and mimicking the API of UICollectionViewFlowLayout, making it familiar to developers already working with standard collection view layouts. The implementation prioritizes performance and can handle thousands of items while maintaining smooth scrolling.
Developers should choose this layout when building image galleries, product feeds, or other interfaces that benefit from a Pinterest-style presentation. The tool supports both Swift and Objective-C implementations, with Swift available through Swift Package Manager and both variants installable via CocoaPods or manual file copying. It handles headers and footers, allows different column counts across sections, and is highly customizable. The project does not position itself against alternatives in the README.
The Swift implementation underwent a complete rewrite in version 1.0.0, raising the minimum deployment target to iOS 13 and tvOS 13 and requiring Swift 5.9 with Xcode 15 or later. The rewrite introduced breaking changes to supplementary view element kinds and the return type of layout attribute queries, moving from non-optional to optional returns. The Objective-C implementation remains unchanged from earlier versions. The project removed deprecated migration shims that had been available in the previous release, requiring users to update any code still referencing old API names.