{"id":20656969,"url":"https://github.com/ahmedalmasri/sncollectionviewlayout","last_synced_at":"2026-03-12T14:38:05.226Z","repository":{"id":62454096,"uuid":"159931780","full_name":"ahmedAlmasri/SNCollectionViewLayout","owner":"ahmedAlmasri","description":"         Collection View Layouts is a set of custom flow layouts for iOS which imitate general data grid approaches for mobile apps.","archived":false,"fork":false,"pushed_at":"2021-05-09T23:27:46.000Z","size":180,"stargazers_count":107,"open_issues_count":1,"forks_count":11,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-28T21:52:51.102Z","etag":null,"topics":["collectionview","collectionviewlayout","grid-layout","ios","ios-swift","swift","swift-library","swift4","uicollectionview","uicollectionviewflowlayout","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/ahmedAlmasri.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":"2018-12-01T10:06:31.000Z","updated_at":"2024-08-08T23:16:26.000Z","dependencies_parsed_at":"2022-11-02T00:00:32.198Z","dependency_job_id":null,"html_url":"https://github.com/ahmedAlmasri/SNCollectionViewLayout","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedAlmasri%2FSNCollectionViewLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedAlmasri%2FSNCollectionViewLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedAlmasri%2FSNCollectionViewLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedAlmasri%2FSNCollectionViewLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmedAlmasri","download_url":"https://codeload.github.com/ahmedAlmasri/SNCollectionViewLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224952045,"owners_count":17397495,"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":["collectionview","collectionviewlayout","grid-layout","ios","ios-swift","swift","swift-library","swift4","uicollectionview","uicollectionviewflowlayout","xcode"],"created_at":"2024-11-16T18:17:50.900Z","updated_at":"2025-10-14T20:35:00.761Z","avatar_url":"https://github.com/ahmedAlmasri.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SNCollectionViewLayout\n\n[![CI Status](https://img.shields.io/travis/ahmedAlmasri/SNCollectionViewLayout.svg?style=flat)](https://travis-ci.org/ahmedAlmasri/SNCollectionViewLayout)\n[![Version](https://img.shields.io/cocoapods/v/SNCollectionViewLayout.svg?style=flat)](https://cocoapods.org/pods/SNCollectionViewLayout)\n[![License](https://img.shields.io/cocoapods/l/SNCollectionViewLayout.svg?style=flat)](https://cocoapods.org/pods/SNCollectionViewLayout)\n[![Platform](https://img.shields.io/cocoapods/p/SNCollectionViewLayout.svg?style=flat)](https://cocoapods.org/pods/SNCollectionViewLayout)\n\n\n\u003cb\u003eScreenShots\u003c/b\u003e\n\n\u003cimg src=\"https://github.com/ahmedAlmasri/SNCollectionViewLayout/blob/master/screenshot/img1.png\"  width=\"450\"\u003e\n\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n## Using \n\n1- Create instance\n\n```swift\n  let snCollectionViewLayout = SNCollectionViewLayout()\n       snCollectionViewLayout.fixedDivisionCount = 4 // Columns for .vertical, rows for .horizontal\n       snCollectionViewLayout.delegate = self\n       myCollectionView.collectionViewLayout = snCollectionViewLayout\n```    \n\n2- Delegate \n\n```swift\n  // scale for items based number of columns\n  func scaleForItem(inCollectionView collectionView: UICollectionView, withLayout layout: UICollectionViewLayout, atIndexPath indexPath: IndexPath) -\u003e UInt {\n        if indexPath.row == 0 || indexPath.row == 3 || indexPath.row == 10 || indexPath.row == 70 {\n            \n            return 2 \n        }\n        return 1\n    }\n    // height for item if set fixedDimension  height equal width\n    func itemFlexibleDimension(inCollectionView collectionView: UICollectionView, withLayout layout: UICollectionViewLayout, fixedDimension: CGFloat) -\u003e CGFloat {\n        return fixedDimension\n    }\n    \n    // header height\n    func headerFlexibleDimension(inCollectionView collectionView: UICollectionView, withLayout layout: UICollectionViewLayout, fixedDimension: CGFloat) -\u003e CGFloat {\n        return 0\n    }\n```\n\n## Requirements\n\n* Swift 4.2+\n* Xcode 10.0+\n* iOS 11.0+\n\n## Installation\n\nSNCollectionViewLayout is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'SNCollectionViewLayout'\n```\n\n## Author\n\nahmedAlmasri, ahmed.almasri@ymail.com\n\n## License\n\nSNCollectionViewLayout is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedalmasri%2Fsncollectionviewlayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmedalmasri%2Fsncollectionviewlayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedalmasri%2Fsncollectionviewlayout/lists"}