{"id":13467037,"url":"https://github.com/netguru/CarLensCollectionViewLayout","last_synced_at":"2025-03-26T00:31:51.779Z","repository":{"id":56905634,"uuid":"162590255","full_name":"netguru/CarLensCollectionViewLayout","owner":"netguru","description":"An easy-to-use Collection View Layout for card-like animation.","archived":true,"fork":false,"pushed_at":"2019-09-30T19:22:35.000Z","size":57,"stargazers_count":547,"open_issues_count":0,"forks_count":39,"subscribers_count":20,"default_branch":"develop","last_synced_at":"2025-03-25T10:43:27.635Z","etag":null,"topics":["animation","cards","collectionview","collectionviewflowlayout","collectionviewlayout","flowlayout","ios","ios-swift","iphone","swift","swift4","ui","uicollectionview","uicollectionviewflowlayout","uicollectionviewlayout"],"latest_commit_sha":null,"homepage":"https://www.netguru.com/codestories/introducing-carlenscollectionviewlayout-a-new-open-source-ios-tool-by-netguru","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/netguru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-20T14:28:00.000Z","updated_at":"2024-12-07T02:26:02.000Z","dependencies_parsed_at":"2022-08-20T19:20:25.059Z","dependency_job_id":null,"html_url":"https://github.com/netguru/CarLensCollectionViewLayout","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netguru%2FCarLensCollectionViewLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netguru%2FCarLensCollectionViewLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netguru%2FCarLensCollectionViewLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netguru%2FCarLensCollectionViewLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netguru","download_url":"https://codeload.github.com/netguru/CarLensCollectionViewLayout/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245566099,"owners_count":20636391,"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":["animation","cards","collectionview","collectionviewflowlayout","collectionviewlayout","flowlayout","ios","ios-swift","iphone","swift","swift4","ui","uicollectionview","uicollectionviewflowlayout","uicollectionviewlayout"],"created_at":"2024-07-31T15:00:52.472Z","updated_at":"2025-03-26T00:31:50.933Z","avatar_url":"https://github.com/netguru.png","language":"Swift","funding_links":[],"categories":["Libs","UI [🔝](#readme)","Content"],"sub_categories":["UI","Layout"],"readme":"# CarLensCollectionViewLayout\n\n![](https://img.shields.io/badge/swift-4.2-orange.svg)\n![](https://img.shields.io/badge/cocoapods-compatible-green.svg)\n![](https://img.shields.io/badge/carthage-compatible-green.svg)\n![](https://app.bitrise.io/app/23a07b63b3f55f97/status.svg?token=Rt_2gKUavbR8LQ7PVuTbYg\u0026branch=master)\n\nAn easy-to-use Collection View Layout for card-like animation 🎉\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"https://user-images.githubusercontent.com/18245585/50694808-2b795e80-103b-11e9-839d-f2d8dc533bb4.gif\" width=\"250\"\u003e\n\u003c/p\u003e\n\n*CarLensCollectionViewLayout* was created out of the implementation in [**CarLens** application 🚘](https://github.com/netguru/car-recognition-ios). The image above exactly shows the screen from the app! \n\n## Requirements\n\n*CarLensCollectionViewLayout* is written in **Swift 4.2** and supports **iOS 9.0+**.\n\n\n## Usage\n\n### Basic Usage\n\nThe two main steps are needed for the configuration of *CarLensCollectionViewLayout*:\n\n#### Step 1\nAssign `CarLensCollectionViewLayout` to yours collection view layout:\n```swift\ncollectionView.collectionViewLayout = CarLensCollectionViewLayout()\n```\nor initialize your collection view with `CarLensCollectionViewLayout`:\n```swift\nUICollectionView(frame: .zero, collectionViewLayout: CarLensCollectionViewLayout())\n```\n\n#### Step 2\nSubsclass `CarLensCollectionViewCell` and call `configure(topView: UIView, cardView: UIView)` during the cell’s initialization:\n```swift\nclass CollectionViewCell: CarLensCollectionViewCell {\n    override init(frame: CGRect) {\n\tsuper.init(frame: frame)\n\tconfigure(topView: upperView, cardView: bottomView)\n    }\n}\n```\nThe sample implementation is available in [Demo](CarLensCollectionViewLayoutDemo) project.\n\n### Customization\n\n#### Layout\nYou can also initialize `CarLensCollectionViewLayout` with a `CarLensCollectionViewLayoutOptions` object by passing any of the parameters available. Others will be configured automatically.\n\n**Parameters:**\n\n`minimumSpacing` - A minimum spacing between cells.\n\n`decelerationRate` - A deceleration for a scroll view.\n\n`shouldShowScrollIndicator` - A value indicating whether collection view should have a scroll indicator.\n\n`itemSize` - The size to use for cells.\n\nExample:\n```swift\nlet options = CarLensCollectionViewLayoutOptions(minimumSpacing: 40)\ncollectionView.collectionViewLayout = CarLensCollectionViewLayout(options: options)\n```\n\n#### Cell\nWhile subsclassing `CarLensCollectionViewCell` you can call `configure(...)` with an additional parameter `topViewHeight`. The card view height will be calculated based on this value.\n\nExample:\n```swift\nclass CollectionViewCell: CarLensCollectionViewCell {\n    override init(frame: CGRect) {\n\tsuper.init(frame: frame)\n\tconfigure(topView: upperView, cardView: bottomView, topViewHeight: 300)\n    }\n}\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/18245585/51251539-dd991a80-1999-11e9-8c60-702310ad4dc4.gif\" height=\"500\"\u003e\t\u003cimg src=\"https://user-images.githubusercontent.com/18245585/51251540-dd991a80-1999-11e9-83f3-432357d7aa22.gif\" height=\"500\"\u003e\n\t\u003cimg src=\"https://user-images.githubusercontent.com/18245585/51251541-de31b100-1999-11e9-9e49-07a3cf5d425b.gif\" height=\"500\"\u003e\n\u003c/p\u003e\n\n## Installation\n\n### CocoaPods\n\nIf you're using [CocoaPods](http://cocoapods.org), add the following dependency to your `Podfile`:\n\n```none\nuse_frameworks!\npod 'CarLensCollectionViewLayout', '~\u003e 1.2.0'\n```\n\n### Carthage\n\nIf you're using [Carthage](https://github.com/Carthage/Carthage), add the following dependency to your `Cartfile`:\n\n```none\ngithub \"netguru/CarLensCollectionViewLayout\" ~\u003e 1.2.0\n```\n\n## About\n\nThis project is made with ❤️ by [Netguru](https://netguru.co) and maintained by [Anna-Mariia Shkarlinska](https://github.com/anyashka).\n\n### License\n\n*CarLensCollectionViewLayout* is licensed under the MIT License. See [LICENSE.md](LICENSE.md) for more info.\n\n## Read More\n\n- [Introducing CarLensCollectionViewLayout - a New Open Source iOS Tool by Netguru](https://www.netguru.com/codestories/introducing-carlenscollectionviewlayout-a-new-open-source-ios-tool-by-netguru)\n- [How We Built CarLens](https://www.netguru.com/blog/machine-learning-and-augmented-reality-combined-in-one-sleek-mobile-app-how-we-built-car-lens)\n- [Increasing the Accuracy of the Machine Learning Model in CarLens](https://www.netguru.com/blog/improving-machine-learning-model-carlens-case-study)\n\n## Related Links\n\n- [CarLens Page](https://www.netguru.com/carlens)\n- [CarLens iOS](https://github.com/netguru/CarLens-iOS)\n- [CarLens in App Store](https://itunes.apple.com/us/app/carlens/id1417168518?mt=8)\n- [CarLens Android](https://github.com/netguru/CarLens-Android)\n- [CarLens on Google Play](https://play.google.com/store/apps/details?id=co.netguru.android.carrecognition\u0026hl=en)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetguru%2FCarLensCollectionViewLayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetguru%2FCarLensCollectionViewLayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetguru%2FCarLensCollectionViewLayout/lists"}