ETCollectionViewWaterFallLayout
ETCollectionViewWaterFallLayout is a subclass of UICollectionViewLayout written completely in Swift!
Install / Use
/learn @ElegantTeam/ETCollectionViewWaterFallLayoutREADME
ETCollectionViewWaterFallLayout
ETCollectionViewWaterFallLayout is the swift version of CHTCollectionViewWaterfallLayout!
Screen Shots

Installation
The preferred way of installation is via CocoaPods. Just add
pod 'ETCollectionViewWaterFallLayout'
and run pod install. It will install the most recent version of ETCollectionViewWaterFallLayout.
Usage
Below are the public properties and their default values that you can change to customize the layout
let layout = ETCollectionViewWaterfallLayout()
layout.minimumColumnSpacing = 10.0
layout.minimumInteritemSpacing = 10.0
layout.columnCount = 2
layout.headerHeight = 0.0
layout.footerHeight = 0.0
layout.headerInset = .zero
layout.footerInset = .zero
layout.sectionInset = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
collectionView.collectionViewLayout = layout
Required Protocol
Your collection view's delegate must conforms to ETCollectionViewDelegateWaterfallLayout 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, sizeForItemAt indexPath: IndexPath) -> CGSize
Support
- iOS 9.0+
- Xcode 8.0+
- Swift 5.0
Objective-C Version
- chiahsien: CHTCollectionViewWaterfallLayout
LICENSE
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Related Skills
node-connect
340.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
340.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.2kCommit, push, and open a PR
