{"id":24302909,"url":"https://github.com/digipolitan/collection-view-grid-layout","last_synced_at":"2025-09-26T06:30:21.388Z","repository":{"id":56906273,"uuid":"78132233","full_name":"Digipolitan/collection-view-grid-layout","owner":"Digipolitan","description":null,"archived":false,"fork":false,"pushed_at":"2019-05-08T10:24:56.000Z","size":1264,"stargazers_count":24,"open_issues_count":0,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-03-14T23:47:43.504Z","etag":null,"topics":["carthage","cocoapods","collection-view","fastlane","framework","ios","swift","tvos"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Digipolitan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-05T17:06:57.000Z","updated_at":"2022-04-26T19:06:29.000Z","dependencies_parsed_at":"2022-08-21T03:20:53.779Z","dependency_job_id":null,"html_url":"https://github.com/Digipolitan/collection-view-grid-layout","commit_stats":null,"previous_names":["digipolitan/collection-view-grid-layout-swift"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Digipolitan%2Fcollection-view-grid-layout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Digipolitan%2Fcollection-view-grid-layout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Digipolitan%2Fcollection-view-grid-layout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Digipolitan%2Fcollection-view-grid-layout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Digipolitan","download_url":"https://codeload.github.com/Digipolitan/collection-view-grid-layout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234292502,"owners_count":18809359,"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":["carthage","cocoapods","collection-view","fastlane","framework","ios","swift","tvos"],"created_at":"2025-01-17T00:20:02.603Z","updated_at":"2025-09-26T06:30:20.439Z","avatar_url":"https://github.com/Digipolitan.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"CollectionViewGridLayout\n=================================\n\n[![Swift Version](https://img.shields.io/badge/swift-5.0-orange.svg?style=flat)](https://developer.apple.com/swift/)\n[![Build Status](https://travis-ci.org/Digipolitan/collection-view-grid-layout.svg?branch=master)](https://travis-ci.org/Digipolitan/collection-view-grid-layout)\n[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/CollectionViewGridLayout.svg)](https://img.shields.io/cocoapods/v/CollectionViewGridLayout.svg)\n[![Carthage Compatible](https://img.shields.io/badge/carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Platform](https://img.shields.io/cocoapods/p/CollectionViewGridLayout.svg?style=flat)](http://cocoadocs.org/docsets/CollectionViewGridLayout)\n[![Twitter](https://img.shields.io/badge/twitter-@Digipolitan-blue.svg?style=flat)](http://twitter.com/Digipolitan)\n\nLayout that allows you to display collection of data in grid without only **very few** lines of codes.\nIt can have the look of a `UITableView` or a `UICollectionView`.\n\n![CollectionGridViewLayout Sample](https://github.com/Digipolitan/collection-view-grid-layout/blob/master/Screenshots/grid-1.gif?raw=true \"Example 1\")\n![CollectionGridViewLayout Sample](https://github.com/Digipolitan/collection-view-grid-layout/blob/master/Screenshots/grid-2.gif?raw=true \"Example 2\")\n\n## Installation\n\n### CocoaPods\n\nTo install CollectionViewGridLayout with CocoaPods, add the following lines to your `Podfile`.\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '9.0'\nuse_frameworks!\n\npod 'CollectionViewGridLayout'\n```\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate CollectionViewGridLayout into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```\ngithub 'Digipolitan/collection-view-grid-layout ~\u003e 2.1\n```\n\nRun `carthage update` to build the framework and drag the built `CollectionViewGridLayout.framework` into your Xcode project.\n\n## Usage\n\n- Initialize your layout by instantiate a `CollectionViewVerticalGridLayout` or `CollectionViewHorizontalGridLayout`.\n\n```swift\n\tlet layout =  CollectionViewVerticalGridLayout()\n```\n\n### Interacting with the component\n\nTo Communicate with the layout, use the same way than `UICollectionViewFlowLayout`. Declare your component as `CollectionViewDelegateVerticalGridLayout` or `CollectionViewDelegateHorizontalGridLayout`, those inheriting respectively from `UICollectionViewDelegate` and `UICollectionViewDataSource` you just have to assign it to your `collectionView`.\n\n```swift\nself.collectionView.delegate = self\nself.collectionView.dataSource = self\n```\n\n- Common protocol for all grid layout direction\n\n```swift\n  @objc optional func collectionView(_ collectionView: UICollectionView,\n                                       layout collectionViewLayout: UICollectionViewLayout,\n                                       rowSpacingForSection section: Int) -\u003e CGFloat\n\n  @objc optional func collectionView(_ collectionView: UICollectionView,\n                                       layout collectionViewLayout: UICollectionViewLayout,\n                                       columnSpacingForSection section: Int) -\u003e CGFloat\n\n  @objc optional func collectionView(_ collectionView: UICollectionView,\n                                       layout collectionViewLayout: UICollectionViewLayout,\n                                       insetForSection section: Int) -\u003e UIEdgeInsets\n```\n\n- CollectionViewDelegateVerticalGridLayout\n\n```swift\n  @objc optional func collectionView(_ collectionView: UICollectionView,\n                                       layout collectionViewLayout: UICollectionViewLayout,\n                                       numberOfColumnsForSection section: Int) -\u003e Int\n\n  @objc optional func collectionView(_ collectionView: UICollectionView,\n                                       layout collectionViewLayout: UICollectionViewLayout,\n                                       weightForColumn column: Int,\n                                       inSection section: Int) -\u003e CGFloat\n\n  @objc optional func collectionView(_ collectionView: UICollectionView,\n                                       layout collectionViewLayout: UICollectionViewLayout,\n                                       heightForItemAt indexPath: IndexPath,\n                                       columnWidth: CGFloat) -\u003e CGFloat\n\n  @objc optional func collectionView(_ collectionView: UICollectionView,\n                                       layout collectionViewLayout: UICollectionViewLayout,\n                                       heightForHeaderInSection section: Int) -\u003e CGFloat\n\n  @objc optional func collectionView(_ collectionView: UICollectionView,\n                                       layout collectionViewLayout: UICollectionViewLayout,\n                                       heightForFooterInSection section: Int) -\u003e CGFloat\n```\n\n- CollectionViewDelegateHorizontalGridLayout\n\n```swift\n  @objc optional func collectionView(_ collectionView: UICollectionView,\n                                       layout collectionViewLayout: UICollectionViewLayout,\n                                       numberOfRowsForSection section: Int) -\u003e Int\n\n  @objc optional func collectionView(_ collectionView: UICollectionView,\n                                       layout collectionViewLayout: UICollectionViewLayout,\n                                       weightForRow row: Int,\n                                       inSection section: Int) -\u003e CGFloat\n\n  @objc optional func collectionView(_ collectionView: UICollectionView,\n                                       layout collectionViewLayout: UICollectionViewLayout,\n                                       widthForItemAt indexPath: IndexPath,\n                                       rowHeight: CGFloat) -\u003e CGFloat\n\n  @objc optional func collectionView(_ collectionView: UICollectionView,\n                                       layout collectionViewLayout: UICollectionViewLayout,\n                                       widthForHeaderInSection section: Int) -\u003e CGFloat\n\n  @objc optional func collectionView(_ collectionView: UICollectionView,\n                                       layout collectionViewLayout: UICollectionViewLayout,\n                                       widthForFooterInSection section: Int) -\u003e CGFloat\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for more details!\n\nThis project adheres to the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md).\nBy participating, you are expected to uphold this code. Please report\nunacceptable behavior to [contact@digipolitan.com](mailto:contact@digipolitan.com).\n\n## License\n\nCollectionViewGridLayout is licensed under the [BSD 3-Clause license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigipolitan%2Fcollection-view-grid-layout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigipolitan%2Fcollection-view-grid-layout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigipolitan%2Fcollection-view-grid-layout/lists"}