{"id":2908,"url":"https://github.com/chiahsien/CHTCollectionViewWaterfallLayout","last_synced_at":"2025-08-03T12:31:41.769Z","repository":{"id":5600906,"uuid":"6807826","full_name":"chiahsien/CHTCollectionViewWaterfallLayout","owner":"chiahsien","description":"The waterfall (i.e., Pinterest-like) layout for UICollectionView.","archived":false,"fork":false,"pushed_at":"2022-09-29T11:25:24.000Z","size":21897,"stargazers_count":4544,"open_issues_count":49,"forks_count":701,"subscribers_count":129,"default_branch":"develop","last_synced_at":"2024-11-29T13:07:25.464Z","etag":null,"topics":["pinterest","uicollectionview","uicollectionviewlayout","waterfall-layout"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chiahsien.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-11-22T04:46:01.000Z","updated_at":"2024-11-25T08:05:49.000Z","dependencies_parsed_at":"2022-06-25T22:38:44.863Z","dependency_job_id":null,"html_url":"https://github.com/chiahsien/CHTCollectionViewWaterfallLayout","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chiahsien%2FCHTCollectionViewWaterfallLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chiahsien%2FCHTCollectionViewWaterfallLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chiahsien%2FCHTCollectionViewWaterfallLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chiahsien%2FCHTCollectionViewWaterfallLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chiahsien","download_url":"https://codeload.github.com/chiahsien/CHTCollectionViewWaterfallLayout/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228543193,"owners_count":17934444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pinterest","uicollectionview","uicollectionviewlayout","waterfall-layout"],"created_at":"2024-01-05T20:16:26.025Z","updated_at":"2025-08-03T12:31:41.744Z","avatar_url":"https://github.com/chiahsien.png","language":"Objective-C","readme":"CHTCollectionViewWaterfallLayout\n================================\n\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)\n[![Version](https://cocoapod-badges.herokuapp.com/v/CHTCollectionViewWaterfallLayout/badge.png)](http://cocoadocs.org/docsets/CHTCollectionViewWaterfallLayout)\n[![Platform](https://cocoapod-badges.herokuapp.com/p/CHTCollectionViewWaterfallLayout/badge.png)](http://cocoadocs.org/docsets/CHTCollectionViewWaterfallLayout)\n[![Build Status](https://github.com/chiahsien/CHTCollectionViewWaterfallLayout/workflows/CHTCollectionViewWaterfallLayout%20CI/badge.svg?branch=develop)](https://github.com/chiahsien/CHTCollectionViewWaterfallLayout/actions)\n\n**CHTCollectionViewWaterfallLayout** is a subclass of [UICollectionViewLayout], and it trys to imitate [UICollectionViewFlowLayout]'s usage as much as possible.\n\nThis layout is inspired by [Pinterest].\n\nScreen Shots\n------------\n![2 columns](https://cloud.githubusercontent.com/assets/474/3419095/25b4de9e-fe56-11e3-9b98-690319d736ce.png)\n\nFeatures\n--------\n* Easy to use, it tries to imitate [UICollectionViewFlowLayout]'s usage as much as possible.\n* Highly customizable.\n* Outstanding performance, try 10,000+ items and see the smoothness for yourself.\n* Support header and footer views.\n* Different column counts in different sections.\n\n\u003ca href=\"https://www.buymeacoffee.com/chiahsien\"\u003e\u003cimg src=\"https://img.buymeacoffee.com/button-api/?text=Buy me a coffee\u0026emoji=\u0026slug=chiahsien\u0026button_colour=5F7FFF\u0026font_colour=ffffff\u0026font_family=Comic\u0026outline_colour=000000\u0026coffee_colour=FFDD00\" /\u003e\u003c/a\u003e\n\nRequirements\n------------\n* iOS 9+ / tvOS 9+\n* Objective-C or Swift 4.2\n\nHow to install\n--------------\n* [CocoaPods]\n  - Add `pod 'CHTCollectionViewWaterfallLayout'` to your Podfile.\n  - If you prefer Objective-C, `pod 'CHTCollectionViewWaterfallLayout/ObjC'` is ready for you.\n\n* [Carthage]\n  - Add `github chiahsien/CHTCollectionViewWaterfallLayout` to your Cartfile.\n\n* [Swift Package Manager]\n  - Add it to the `dependencies` value of your `Package.swift`.\n  ```\n  dependencies: [\n    .package(url: \"https://github.com/chiahsien/CHTCollectionViewWaterfallLayout.git\", from: \"0.9.9\")\n  ]\n  ```\n\n* Manual\n  - Copy `CHTCollectionViewWaterfallLayout.h/m` or `CHTCollectionViewWaterfallLayout.swift` to your project.\n\nHow to Use\n----------\nRead the demo codes and `CHTCollectionViewWaterfallLayout.h` header file for more information.\n\n#### Step 1\nBelow lists the properties for you to customize the layout. Although they have default values, I strongly recommend you to set up at least the `columnCount` property to suit your needs.\nThe `itemRenderDirection` property is an enum which decides the order in which your items will be rendered in subsequent rows. For eg. Left-Right | Right-Left | Shortest column filling up first.\n\n``` objc\n@property (nonatomic, assign) NSInteger columnCount;\n@property (nonatomic, assign) CGFloat minimumColumnSpacing;\n@property (nonatomic, assign) CGFloat minimumInteritemSpacing;\n@property (nonatomic, assign) CGFloat headerHeight;\n@property (nonatomic, assign) CGFloat footerHeight;\n@property (nonatomic, assign) UIEdgeInsets sectionInset;\n@property (nonatomic, assign) ItemRenderDirection itemRenderDirection;\n```\n\n#### Step 2\nYour collection view's delegate (which often is your view controller) must conforms to `CHTCollectionViewDelegateWaterfallLayout` protocol and implements the required method, all you need to do is return the original size of the item:\n\n``` objc\n- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath;\n```\n\nLimitation\n----------\n* Only vertical scrolling is supported.\n* No decoration view.\n\nWho is using it\n---------------\nPlease let me know if your app is using this library. I'm glad to put your app on the list :-)\n\n* [F3PiX](https://itunes.apple.com/us/app/samenwerken-f3pix/id897714553?mt=8)\nF3PiX is a series of apps which gives you a concise, curated collection of pictures by professional (Dutch) photographers according to a specific theme. You can use the pictures freely for your own work.\n* [GroupMe for iOS](https://itunes.apple.com/us/app/groupme/id392796698?mt=8)\nGroupMe - A Home for All the Groups in Your Life.\n* [Flickr](https://itunes.apple.com/us/app/id328407587)\nAccess and organize your photos from anywhere.\n* [Tumblr](https://www.tumblr.com/policy/en/ios-credits)\nPost whatever you want to your Tumblr. Follow other people who are doing the same. You’ll probably never be bored again.\n* [Funliday](https://itunes.apple.com/us/app/funlidays-lu-you-gui-hua/id905768387)\nThe best trip planning app in the world!\n* [Imgur](https://itunes.apple.com/us/app/imgur-funny-gifs-memes-images/id639881495?mt=8)\nFunny GIFs, Memes, and Images!\n* [DealPad](https://itunes.apple.com/us/app/dealpad-bargains-freebies/id949294107?mt=8)\nDealPad gives you access to the UK’s hottest Deals, Voucher Codes and Freebies in the palm of your hand.\n* [Teespring Shopping](https://itunes.apple.com/app/apple-store/id1144693237?pt=117854047\u0026ct=CHTCollectionViewWaterfallLayout%20README\u0026mt=8)\nBrowse and purchase shirts, mugs, totes and more!\n\nLicense\n-------\nCHTCollectionViewWaterfallLayout is available under the MIT license. See the LICENSE file for more info.\n\nChangelog\n---------\nRefer to the [Releases page](https://github.com/chiahsien/CHTCollectionViewWaterfallLayout/releases).\n\n[UICollectionViewLayout]: http://developer.apple.com/library/ios/#documentation/uikit/reference/UICollectionViewLayout_class/Reference/Reference.html\n[UICollectionViewFlowLayout]: https://developer.apple.com/library/ios/documentation/uikit/reference/UICollectionViewFlowLayout_class/Reference/Reference.html\n[Pinterest]: http://pinterest.com/\n[CocoaPods]: http://cocoapods.org/\n[Carthage]: https://github.com/Carthage/Carthage\n[Swift Package Manager]: https://swift.org/package-manager/\n","funding_links":["https://www.buymeacoffee.com/chiahsien","https://img.buymeacoffee.com/button-api/?text=Buy"],"categories":["UI","Objective-C","UI Components","uicollectionviewlayout","Uncategorized"],"sub_categories":["Table View / Collection View","Layout","Other free courses","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchiahsien%2FCHTCollectionViewWaterfallLayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchiahsien%2FCHTCollectionViewWaterfallLayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchiahsien%2FCHTCollectionViewWaterfallLayout/lists"}