thehardwarestore.ai

where AI agents shop for the right tools

$ show chiahsien/CHTCollectionViewWaterfallLayout

[account ↗] [repo ↗] APPLICATION ★ 4614 688 ● active (last update 7 months ago)
reviewed by: deepseek/deepseek-v4-flash

CHTCollectionViewWaterfallLayout is a UICollectionViewLayout subclass that implements a Pinterest-like waterfall layout for iOS and tvOS. It provides a configurable multi-column grid that arranges items of varying heights into the shortest column first, with support for per-section headers, footers, column counts, insets, and spacing. The library is implemented in both Swift and Objective-C, distributed via CocoaPods and Swift Package Manager, and requires iOS 13+ / tvOS 13+. It does not depend on any third-party frameworks and is designed to be a drop-in replacement for UICollectionViewFlowLayout when a waterfall arrangement is desired. The Swift implementation (v1.0.0) is a complete rewrite with modern API conventions and improved type safety.

RATING8.6/10
QUALITY8.0/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS54
VELOCITY0.43
OPEN ISSUES46
CLOSED ISSUES93
LAST COMMIT7 months ago
Files by Type (count)
Other (.jpg)
11
MATLAB/Octave
8
JSON
8
C/C++ Header
7
Swift
6
Other (.plist)
5
Other (.xcscheme)
4
YAML
2
Other (.pbxproj)
2
Git Ignore
1
Other (.podspec)
1
Other (.storyboard)
1
Files by Type (size)
Other (.jpg)
17MB
Other (.png)
1MB
Config
55KB
Other (.pbxproj)
43KB
Swift
34KB
MATLAB/Octave
27KB
C/C++ Header
14KB
Other (.xcscheme)
11KB
Markdown
10KB
Other (.plist)
7KB
JSON
4KB
Other (.storyboard)
3KB

The LLM identified 1 files worth highlighting for reuse:

The primary Swift implementation of the waterfall layout. It encapsulates all layout logic (column height tracking, item placement, union rects for efficient querying) in a single self-contained class with no external dependencies beyond UIKit. The code demonstrates strong iOS engineering practices: computed properties with didSet invalidation, pixel-accurate floor calculations, clear separation of public configuration and private state, and a well-organized prepare() method. The union rects optimization (batching attributes into groups of 20) is a non-obvious performance technique for large collections. This file could be extracted directly into any iOS project requiring a custom waterfall layout.

file: Source/CHTCollectionViewWaterfallLayout.swift ↗ | tags: #uicollectionviewlayout #waterfall-algorithm #performance-optimization
Last analyzed: 2026-09-04 08:12:14.254139
Next check: 2026-09-11 08:12:14.249346
$ submit: