{"id":16754656,"url":"https://github.com/vkt0r/accordionswift","last_synced_at":"2026-04-03T23:33:45.643Z","repository":{"id":26912349,"uuid":"30374284","full_name":"Vkt0r/AccordionSwift","owner":"Vkt0r","description":"The best way of implement an accordion menu using an UITableView in Swift","archived":false,"fork":false,"pushed_at":"2021-03-17T09:44:37.000Z","size":5002,"stargazers_count":176,"open_issues_count":15,"forks_count":29,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-08-23T09:42:14.805Z","etag":null,"topics":["accordion","cocoapods","swift","tableview","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/Vkt0r.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":"2015-02-05T19:36:05.000Z","updated_at":"2025-08-09T11:25:54.000Z","dependencies_parsed_at":"2022-08-31T13:53:55.216Z","dependency_job_id":null,"html_url":"https://github.com/Vkt0r/AccordionSwift","commit_stats":null,"previous_names":["vkt0r/accordionmenuswift"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/Vkt0r/AccordionSwift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vkt0r%2FAccordionSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vkt0r%2FAccordionSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vkt0r%2FAccordionSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vkt0r%2FAccordionSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vkt0r","download_url":"https://codeload.github.com/Vkt0r/AccordionSwift/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vkt0r%2FAccordionSwift/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272612272,"owners_count":24964388,"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-29T02:00:10.610Z","response_time":87,"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":["accordion","cocoapods","swift","tableview","xcode"],"created_at":"2024-10-13T03:05:30.565Z","updated_at":"2025-12-12T06:03:01.164Z","avatar_url":"https://github.com/Vkt0r.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"repo-logo.png\" alt=\"Accordion Custom Image\" width=650/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://cocoapods.org/pods/AccordionSwift\"\u003e\n        \u003cimg src=\"https://img.shields.io/cocoapods/v/AccordionSwift.svg?style=flat\"\n             alt=\"Pods Version\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://swift.org\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Swift-5.0-orange.svg\"\n             alt=\"Swift Version\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"http://mit-license.org\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg?style=flat\"\n             alt=\"License Type\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n----------------\n\n_An accordion/dropdown menu to integrate in your projects. This library is protocol oriented, type safe and the new version is inspired in [JSQDataSourcesKit](https://github.com/jessesquires/JSQDataSourcesKit) by Jesse Squires_.\n\n\n|         | Main Features  |\n----------|-----------------\n📱 | Compatible with iPhone / iPad\n🔨 | Fully customizable cells\n🚒 | Supports device rotation\n🔥 | Written completely in Swift \n\n\n## Requirements 💥\n- iOS 10.0+\n- Xcode 10.2+\n\n## Installation\n\n### CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\n\u003e CocoaPods 1.1.0+ is required to build AccordionSwift 2.0.0+.\n\nTo integrate AccordionSwift into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '10.0'\nuse_frameworks!\n\ntarget '\u003cYour Target Name\u003e' do\n    pod 'AccordionSwift', '~\u003e 2.0.0'\nend\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\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. To integrate AccordionSwift into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"Vkt0r/AccordionSwift\" ~\u003e 2.0.0\n```\n\n## Usage ✨\nAfter importing the framework, the library can be used in a `UITableViewController` or a `UIViewController` and offers full customization of the cells and data source:\n\n```swift\nimport UIKit\nimport AccordionSwift\n\nclass AccordionViewController: UIViewController {\n    \n    // MARK: - IBOutlets\n    \n    @IBOutlet weak var tableView: UITableView!\n    \n    // MARK: - Typealias\n    \n    typealias ParentCellModel = Parent\u003cGroupCellModel, CountryCellModel\u003e\n    typealias ParentCellConfig = CellViewConfig\u003cParentCellModel, UITableViewCell\u003e\n    typealias ChildCellConfig = CellViewConfig\u003cCountryCellModel, CountryTableViewCell\u003e\n    \n    // MARK: - Properties\n    \n    /// The Data Source Provider with the type of DataSource and the different models for the Parent and Chidl cell.\n    var dataSourceProvider: DataSourceProvider\u003cDataSource\u003cParentCellModel\u003e, ParentCellConfig, ChildCellConfig\u003e?\n    \n    // MARK: - UIViewController\n    \n    override func viewDidLoad() {\n        super.viewDidLoad()\n        configDataSource()\n        \n        navigationItem.title = \"World Cup 2018\"\n    }\n}\n```\nThe above example shows how to define a `CellViewConfig` for the parent and child cells respectively and how to define the `Parent` model. \n\n```swift\n/// Defines a cell config type to handle a UITableViewCell\npublic protocol CellViewConfigType {\n    \n    // MARK: Associated types\n    \n    /// The type of elements backing the collection view or table view.\n    associatedtype Item\n    \n    /// The type of views that the configuration produces.\n    associatedtype Cell: UITableViewCell\n    \n    // MARK: Methods\n    \n    func reuseIdentiferFor(item: Item?, indexPath: IndexPath) -\u003e String\n    \n    @discardableResult\n    func configure(cell: Cell, item: Item?, tableView: UITableView, indexPath: IndexPath) -\u003e Cell\n}\n```\n\nAnother step is to define the `DataSourceProvider` in charge of handling the data source and the `CellViewConfig` for each cell. \nThe `DataSourceProvider` exposes the `numberOfExpandedParentCells` attribute which can be used to change the behavior of the accordion to only have a `single` item open at once or to have `multiple` items open at any given time. Take note that the default behavior is to have multiple items open.\n\nFor a more detailed guide please see the [Example](https://github.com/Vkt0r/AccordionSwift/tree/master/Example) project.\n\n## Screenshots\n\u003cimg src=\"https://user-images.githubusercontent.com/30416075/66836060-f2263580-ef60-11e9-9ee5-a46d6c24ca10.png\" alt=\"screenshot\" width=\"450\"/\u003e\n\n#### Example of multiple cells open at a time\n\u003cimg src=\"https://user-images.githubusercontent.com/30416075/66833387-09aeef80-ef5c-11e9-983c-552b2bed5fd9.gif\" alt=\"screenshot\" width=\"450\"/\u003e\n\n#### Example of single cells open at a time\n\u003cimg src=\"https://user-images.githubusercontent.com/30416075/66833395-0f0c3a00-ef5c-11e9-9a98-5ccf65a875c9.gif\" alt=\"screenshot\" width=\"450\"/\u003e\n\n## TODO\n\n- [ ] Add unit tests for the library.\n- [ ] Add CircleCI integration.\n\n\n## Feedback\n\n## I've found a bug, or have a feature request\n\nPlease raise a [GitHub issue](https://github.com/Vkt0r/AccordionMenu/issues). 😱\n\n## Interested in contributing?\n\nGreat! Please launch a [pull request](https://github.com/Vkt0r/AccordionMenu/pulls). 👍\n\n---------------------------------------\n\nLicense:\n=================\nThe MIT License. See the [LICENSE file](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvkt0r%2Faccordionswift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvkt0r%2Faccordionswift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvkt0r%2Faccordionswift/lists"}