Add a Pinterest-style waterfall grid to any iOS app using UICollectionView with minimal API changes from the standard flow layout
Display a photo feed or card list where items have varying heights arranged across multiple columns
Customize column count, spacing, header/footer heights, and fill order independently per section in the same collection view
Migrate from UICollectionViewFlowLayout to a waterfall layout using a familiar delegate pattern
Requires iOS 13 or tvOS 13 minimum, Swift Package Manager integration requires Xcode 15 or later. Version 1.0.0 has breaking API changes from 0.9.x documented in the README.
CHTCollectionViewWaterfallLayout is an iOS and tvOS library that adds a Pinterest-style waterfall grid layout to UICollectionView, which is Apple's standard way of displaying scrollable grids and lists in mobile apps. A waterfall layout arranges items in multiple columns where each item takes up a height proportional to its own content, so columns can end at different vertical positions rather than staying perfectly even. This creates the staggered, dynamic look associated with apps like Pinterest. The library is designed to feel similar to UICollectionViewFlowLayout, which is the built-in grid layout Apple provides. The goal is that iOS developers who already know how to use the standard layout can adopt this one without learning a completely different API. The README says the library is highly customizable and handles performance well even with large numbers of items, citing 10,000 or more items as a benchmark for smooth scrolling. Customization is done through properties set on the layout object and through an optional delegate protocol implemented by the view controller. Configurable options include the number of columns, spacing between columns and items, section insets, header and footer heights and insets, and the order in which items fill the columns (left-to-right, right-to-left, or shortest-column-first). Different sections in the same collection view can use different column counts. The library can be added to a project through Swift Package Manager (the recommended approach), CocoaPods, or by copying the source files directly. Both Swift and Objective-C implementations are included, and demo projects for both languages are in the repository. The minimum supported platform is iOS 13 or tvOS 13, and Swift Package Manager requires Xcode 15 or later. Version 1.0.0 was a full rewrite of the Swift implementation and includes several breaking changes from 0.9.x, which the README documents in detail.
← chiahsien on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.