{"id":28304048,"url":"https://github.com/rubygarage/collection-view-layouts","last_synced_at":"2025-06-16T16:31:58.868Z","repository":{"id":45677264,"uuid":"127403394","full_name":"rubygarage/collection-view-layouts","owner":"rubygarage","description":"A library that implements custom flow layouts for iOS apps","archived":false,"fork":false,"pushed_at":"2020-10-03T19:07:13.000Z","size":1076,"stargazers_count":685,"open_issues_count":7,"forks_count":85,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-24T00:08:15.000Z","etag":null,"topics":["500px","collectionview","collectionviewflowlayout","facebook","flickr","flipboard","instagram","ios","pinterest","swift","tags"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rubygarage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-30T08:32:43.000Z","updated_at":"2025-05-07T08:49:06.000Z","dependencies_parsed_at":"2022-08-04T18:30:24.154Z","dependency_job_id":null,"html_url":"https://github.com/rubygarage/collection-view-layouts","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/rubygarage/collection-view-layouts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubygarage%2Fcollection-view-layouts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubygarage%2Fcollection-view-layouts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubygarage%2Fcollection-view-layouts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubygarage%2Fcollection-view-layouts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubygarage","download_url":"https://codeload.github.com/rubygarage/collection-view-layouts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubygarage%2Fcollection-view-layouts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260197274,"owners_count":22973124,"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":["500px","collectionview","collectionviewflowlayout","facebook","flickr","flipboard","instagram","ios","pinterest","swift","tags"],"created_at":"2025-05-24T00:08:15.334Z","updated_at":"2025-06-16T16:31:58.858Z","avatar_url":"https://github.com/rubygarage.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/rubygarage/collection-view-layouts.svg?branch=master)](https://travis-ci.org/rubygarage/collection-view-layouts)\n[![codecov](https://codecov.io/gh/rubygarage/collection-view-layouts/branch/master/graph/badge.svg)](https://codecov.io/gh/rubygarage/collection-view-layouts)\n\n# About\n\nCollection View Layouts is a set of custom layouts for iOS which imitate general data grid approaches for mobile apps.\n\n# Layout types\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n    \t\u003ctd align=\"center\"\u003eTags\u003c/td\u003e\n    \t\u003ctd align=\"center\"\u003ePinterest\u003c/td\u003e\n    \t\u003ctd align=\"center\"\u003e500px\u003c/td\u003e\n    \t\u003ctd align=\"center\"\u003eInstagram\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003cimg src=\"https://github.com/rubygarage/collection-view-layouts/blob/master/assets/tags.png?raw=true\" width=\"200\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"https://github.com/rubygarage/collection-view-layouts/blob/master/assets/pinterest.png?raw=true\" width=\"200\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"https://github.com/rubygarage/collection-view-layouts/blob/master/assets/px500.png?raw=true\" width=\"200\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"https://github.com/rubygarage/collection-view-layouts/blob/master/assets/instagram.png?raw=true\" width=\"200\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n    \t\u003ctd align=\"center\"\u003eFlipboard\u003c/td\u003e\n    \t\u003ctd align=\"center\"\u003eFacebook\u003c/td\u003e\n    \t\u003ctd align=\"center\"\u003eFlickr\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003cimg src=\"https://github.com/rubygarage/collection-view-layouts/blob/master/assets/flipboard.png?raw=true\" width=\"200\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"https://github.com/rubygarage/collection-view-layouts/blob/master/assets/facebook.png?raw=true\" width=\"200\"\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003cimg src=\"https://github.com/rubygarage/collection-view-layouts/blob/master/assets/flickr.png?raw=true\" width=\"200\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## Overview\n* 7 popular layouts for iOS collection view\n* Tags and Flipboard layouts support left and right content align\n* 500px has custom cells layout configuration\n* Three modes for Instagram layout (default grid mode, one preview cell, regular preview cell)\n* Each layout can be configured with content and cells paddings separately\n* Tests coverage more than 90%\n\n## Installation\n\n### CocoaPods\nCollection View Layouts is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following lines (depends on your needs) to your `Podfile`:\n\n```ruby\npod 'collection-view-layouts/Core'\npod 'collection-view-layouts/TagsLayout'\npod 'collection-view-layouts/PinterestLayout'\npod 'collection-view-layouts/Px500Layout'\npod 'collection-view-layouts/InstagramLayout'\npod 'collection-view-layouts/FlipboardLayout'\npod 'collection-view-layouts/FacebookLayout'\npod 'collection-view-layouts/FlickrLayout'\n```\n\n## Requirements\n\niOS: 11.0+  \nSwift: 5.0  \nCocoaPods: for iOS  \n\n## Example\nTo run the example project, clone the repo, and run pod install from the Example directory first.\n\n## Usage\n\nConfiguration of custom layouts is pretty easy:\n\n```swift\nvar layout: BaseLayout = TagsLayout()\n\nlayout.delegate = self\nlayout.delegate = ItemsPadding(horizontal: 10, vertical: 10)\nlayout.cellsPadding = ItemsPadding(horizontal: 8, vertical: 8)\n\ncollectionView.collectionViewLayout = layout\ncollectionView.reloadData()\n```\n\nAlso, you have to implement LayoutDelegate protocol:\n\n```swift\npublic protocol LayoutDelegate: class {\n    func cellSize(indexPath: IndexPath) -\u003e CGSize\n}\n\nfunc cellSize(indexPath: IndexPath) -\u003e CGSize {\n    return cellsSizes[indexPath.row]\n}\n```\n\n\n## Author\n\nSergey Afanasiev\n\n## Getting Help\n\nsergey.afanasiev@rubygarage.org\n\n## License\n\nCollection View Layouts is licensed under the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0)\n\n***\n\n\u003ca href=\"https://rubygarage.org/\"\u003e\u003cimg src=\"https://github.com/rubygarage/collection-view-layouts/blob/master/assets/rubygarage.png?raw=true\" alt=\"RubyGarage Logo\" width=\"415\" height=\"128\"\u003e\u003c/a\u003e\n\nRubyGarage is a leading software development and consulting company in Eastern Europe. Our main expertise includes Ruby and Ruby on Rails, but we successfuly employ other technologies to deliver the best results to our clients. [Check out our portoflio](https://rubygarage.org/portfolio) for even more exciting works!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubygarage%2Fcollection-view-layouts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubygarage%2Fcollection-view-layouts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubygarage%2Fcollection-view-layouts/lists"}