{"id":20162055,"url":"https://github.com/akxo/paging-collection-view-layout","last_synced_at":"2025-08-21T07:32:44.646Z","repository":{"id":40618032,"uuid":"201540821","full_name":"akxo/paging-collection-view-layout","owner":"akxo","description":"custom collection view layout that allows you to page by cell, not screen","archived":false,"fork":false,"pushed_at":"2020-03-11T13:44:13.000Z","size":3733,"stargazers_count":184,"open_issues_count":1,"forks_count":23,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-25T10:05:26.788Z","etag":null,"topics":["carousel","cell","cocoapod","collectionview","collectionviewflowlayout","collectionviewlayout","paging","swift"],"latest_commit_sha":null,"homepage":null,"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/akxo.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":"2019-08-09T21:09:54.000Z","updated_at":"2025-06-06T08:12:01.000Z","dependencies_parsed_at":"2022-08-27T01:11:46.869Z","dependency_job_id":null,"html_url":"https://github.com/akxo/paging-collection-view-layout","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/akxo/paging-collection-view-layout","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akxo%2Fpaging-collection-view-layout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akxo%2Fpaging-collection-view-layout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akxo%2Fpaging-collection-view-layout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akxo%2Fpaging-collection-view-layout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akxo","download_url":"https://codeload.github.com/akxo/paging-collection-view-layout/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akxo%2Fpaging-collection-view-layout/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271444390,"owners_count":24760793,"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","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["carousel","cell","cocoapod","collectionview","collectionviewflowlayout","collectionviewlayout","paging","swift"],"created_at":"2024-11-14T00:23:06.199Z","updated_at":"2025-08-21T07:32:44.274Z","avatar_url":"https://github.com/akxo.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# paging-collection-view-layout\ncustom collection view layout that allows you to page by cell, not screen\n\n![](Media/example.gif)\n## installation\n### cocoapods\nuse [cocoapods](http://cocoapods.org/) to install `PagingCollectionViewLayout` by adding it to your `Podfile`:\n\n```ruby\nplatform :ios, '9.0'\nuse_frameworks!\npod 'PagingCollectionViewLayout'\n```\n\n``` swift\nimport PagingCollectionViewLayout\n```\n### manual\nadd `PagingCollectionViewLayout.swift` to your project\n## usage\n\ninstantiate a layout property\n\n```swift\nlet layout = PagingCollectionViewLayout()\n```\nset the following properties\n```swift\nlayout.itemSize = \nlayout.minimumLineSpacing = \nlayout.scrollDirection = .horizontal\n```\ninstantiate a collection view using the layout property\n```swift\nlet collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)\n```\nfor snappy scrolling set the following\n```swift\ncollectionView.decelerationRate = .fast\n```\n\n#### note:\n~~collectionView.isPagingEnabled = true~~\n## optional customization\n### vertical scrolling\n![](Media/example-vertical.gif)\n```swift\nlayout.scrollDirection = .vertical\n```\nor since the default is vertical\n\n~~layout.scrollDirection = .horizontal~~\n### section spacing\n- center the item in focus\n- allow the previous item to be visible\n\n![](Media/spacing.png)\n![](Media/spacing-vertical.jpg)\n\nset the following property\n```swift\nlayout.sectionInset = \n```\n- **horizontal collection view -** set left and right insets\n- **vertical collection view -** set top and bottom insets\n\n### skipping items\n\n![](Media/example-skip.gif)\n\n`layout.velocityThresholdPerPage` determines the velocity needed to skip an item (default = 2.0)\n- a non zero swipe velocity will result in the collection view scrolling to the prev/next item\n- the number of items skipped = swipe velocity / velocityThresholdPerPage\n\n### multiple items per page\n\n![](Media/example-multiple-items-per-page.gif)\n\n```swift\nlayout.numberOfItemsPerPage = 2\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakxo%2Fpaging-collection-view-layout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakxo%2Fpaging-collection-view-layout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakxo%2Fpaging-collection-view-layout/lists"}