{"id":29627753,"url":"https://github.com/touchlane/campcotcollectionview","last_synced_at":"2025-07-21T08:05:56.099Z","repository":{"id":28632349,"uuid":"118919561","full_name":"touchlane/CampcotCollectionView","owner":"touchlane","description":"Collapse and expand UICollectionView sections with one method call.","archived":false,"fork":false,"pushed_at":"2022-06-15T16:02:20.000Z","size":2432,"stargazers_count":187,"open_issues_count":0,"forks_count":10,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-07-13T05:59:20.510Z","etag":null,"topics":["awesome","cocoapods","collapsible","expandable","ios","library","swift","uicollectionview"],"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/touchlane.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null}},"created_at":"2018-01-25T13:59:37.000Z","updated_at":"2024-12-20T04:07:03.000Z","dependencies_parsed_at":"2022-08-07T14:00:24.148Z","dependency_job_id":null,"html_url":"https://github.com/touchlane/CampcotCollectionView","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/touchlane/CampcotCollectionView","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/touchlane%2FCampcotCollectionView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/touchlane%2FCampcotCollectionView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/touchlane%2FCampcotCollectionView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/touchlane%2FCampcotCollectionView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/touchlane","download_url":"https://codeload.github.com/touchlane/CampcotCollectionView/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/touchlane%2FCampcotCollectionView/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266263057,"owners_count":23901356,"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":["awesome","cocoapods","collapsible","expandable","ios","library","swift","uicollectionview"],"created_at":"2025-07-21T08:05:52.672Z","updated_at":"2025-07-21T08:05:56.080Z","avatar_url":"https://github.com/touchlane.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![LOGO](https://github.com/touchlane/CampcotCollectionView/blob/master/Assets/logo.svg)\n\n![Language](https://img.shields.io/badge/swift-5.0-orange.svg)\n[![Build Status](https://travis-ci.org/touchlane/CampcotCollectionView.svg?branch=master)](https://travis-ci.org/touchlane/CampcotCollectionView)\n[![codecov](https://codecov.io/gh/touchlane/CampcotCollectionView/branch/master/graph/badge.svg)](https://codecov.io/gh/touchlane/CampcotCollectionView)\n[![Version](https://img.shields.io/cocoapods/v/CampcotCollectionView.svg?style=flat)](http://cocoapods.org/pods/CampcotCollectionView)\n[![License](https://img.shields.io/cocoapods/l/CampcotCollectionView.svg?style=flat)](http://cocoapods.org/pods/CampcotCollectionView)\n[![Platform](https://img.shields.io/cocoapods/p/CampcotCollectionView.svg?style=flat)](http://cocoapods.org/pods/CampcotCollectionView)\n\nThis library provides a custom `UICollectionView` that allows to expand and collapse sections. Provides a simple API to manage collection view appearance.\n\n![CampcotCollectionView](Example/Assets/campcot.gif)\n\n# Requirements\n\n* iOS 9.0+\n* Xcode 10.2+\n* Swift 5.0+\n\n# Installation\n\n## CocoaPods\n\n[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```$ gem install cocoapods```\n\nTo integrate CampcotCollectionView into your Xcode project using CocoaPods, specify it in your ```Podfile```:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '9.0'\nuse_frameworks!\n\ntarget '\u003cYour Target Name\u003e' do\n    pod 'CampcotCollectionView'\nend\n```\n\nThen, run the following command:\n\n```$ pod install```\n\n# Usage\n\n### Manual Setup\n\n```swift\nimport CampcotCollectionView\n```\n\n1. Create CollectionView\n```swift\nlet campcotCollectionView = CampcotCollectionView()\n```\n2. Add `campcotCollectionView` to view hierarchy.\n3. Call `toggle` method on `campcotCollectionView`.\n```swift\npublic func toggle(to section: Int,\n                   offsetCorrection: CGFloat = default,\n                   animated: Bool,\n                   completion: ((Bool) -\u003e Void)? = default)\n```\n### Storyboard Setup\n\n1. Add UICollectionView to your Storyboard.\n2. In `Identity Inspector` set the `Class` property to `CampcotCollectionView`.\n3. Open `Attributes Inspector` and set the `Layout` property to `Custom`. Set `Class` property to either `ExpandedLayout` or `CollapsedLayout`.\n4. Create outlet for your collectionView.\n5. Set datasource and delegate for collectionView.\n5. Set the settings for collectionView in  `Attributes Inspector` or manualy.\n\n# Documentation\n\n### CampcotCollectionView\n\nA Boolean value that determines whether the sections are expanded.\n```swift\npublic var isExpanded: Bool { get }\n```\n\nExpands all the sections. Pins a section at index `section` to the top of view bounds.\n`offsetCorrection` - the offset for pinned section from the top. Default value of `offsetCorrection` is `0`.\n`animated` - if `true` expands sections with animation.\n`completion` - callback for animation.\n```swift\npublic func expand(from section: Int,\n                   offsetCorrection: CGFloat = default,\n                   animated: Bool,\n                   completion: ((Bool) -\u003e Void)? = default)\n```\n\nCollapses all the sections. Pins a section at index `section` to the top of view bounds.\n`offsetCorrection` - the offset for pinned section from the top. Default value of `offsetCorrection` is `0`.\n`animated` - if `true` collapses sections with animation.\n`completion` - callback for animation.\n```swift\npublic func collapse(to section: Int,\n                     offsetCorrection: CGFloat = default,\n                     animated: Bool,\n                     completion: ((Bool) -\u003e Void)? = default)\n```\n\nToggles current state from collapsed to expaned and vise versa. Pins a section at index `section` to the top of view bounds.\n`offsetCorrection` - the offset for pinned section from the top. Default value of `offsetCorrection` is `0`.\n`animated` - if `true` toggles sections with animation.\n`completion` - callback for animation.\n```swift\npublic func toggle(to section: Int,\n                   offsetCorrection: CGFloat = default,\n                   animated: Bool,\n                   completion: ((Bool) -\u003e Void)? = default)\n```\n___\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftouchlane%2Fcampcotcollectionview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftouchlane%2Fcampcotcollectionview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftouchlane%2Fcampcotcollectionview/lists"}