{"id":19760201,"url":"https://github.com/younatics/expandablecell","last_synced_at":"2025-05-16T15:07:10.252Z","repository":{"id":41562665,"uuid":"99489471","full_name":"younatics/ExpandableCell","owner":"younatics","description":"✨ Awesome expandable, collapsible tableview cell for iOS written in Swift 5","archived":false,"fork":false,"pushed_at":"2022-03-26T15:18:55.000Z","size":5597,"stargazers_count":773,"open_issues_count":30,"forks_count":124,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-05-12T20:17:00.963Z","etag":null,"topics":["cell","collapsible","expandable","ios","swift5","tableviewcell"],"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/younatics.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":"2017-08-06T13:48:53.000Z","updated_at":"2025-04-30T09:17:04.000Z","dependencies_parsed_at":"2022-07-07T22:34:42.806Z","dependency_job_id":null,"html_url":"https://github.com/younatics/ExpandableCell","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/younatics%2FExpandableCell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/younatics%2FExpandableCell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/younatics%2FExpandableCell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/younatics%2FExpandableCell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/younatics","download_url":"https://codeload.github.com/younatics/ExpandableCell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254553959,"owners_count":22090417,"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":["cell","collapsible","expandable","ios","swift5","tableviewcell"],"created_at":"2024-11-12T03:35:59.677Z","updated_at":"2025-05-16T15:07:10.229Z","avatar_url":"https://github.com/younatics.png","language":"Swift","readme":"# ExpandableCell\n[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)\n[![Version](https://img.shields.io/cocoapods/v/ExpandableCell.svg?style=flat)](http://cocoapods.org/pods/ExpandableCell)\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/younatics/YNExpandableCell/blob/master/LICENSE)\n[![Platform](https://img.shields.io/cocoapods/p/YNExpandableCell.svg?style=flat)](http://cocoapods.org/pods/ExpandableCell)\n[![Swift 5.0](https://img.shields.io/badge/Swift-5.0-orange.svg?style=flat)](https://developer.apple.com/swift/)\n![iOS 8.0+](https://img.shields.io/badge/iOS-8.0%2B-blue.svg)\n\n## Intoduction\nFully refactored [YNExapnadableCell](https://github.com/younatics/YNExpandableCell) with more concise, bug free. Easiest usage of expandable \u0026 collapsible cell for iOS, written in Swift 5. You can customize expandable `UITableViewCell` whatever you like. `ExpandableCell` is made because `insertRows` and `deleteRows` is hard to use. Just inheirt `ExpandableDelegate`\n\n![demo](Images/ExpandableCell.gif)\n\n## Usage\n### Basic\n```swift\nimport ExpandableCell\n```\n\nMake `ExpandableTableView` in Storyboard or in code\n```swift\n@IBOutlet var tableView: ExpandableTableView!\n```\n\nInherit `ExpandableDelegate`\n```swift\nclass ViewController: UIViewController, ExpandableDelegate \n```\n\nSet delegate\n```swift\ntableView.expandableDelegate = self\n```\n\nSet required `ExpandableDelegate` method.\n#### Key two methods\n| Required ExpandableDelegate | Explanation |\n| --------------------------- | ----------- |\n| `func expandableTableView(_ expandableTableView: ExpandableTableView, expandedCellsForRowAt indexPath: IndexPath) -\u003e [UITableViewCell]?` | Key method to get expandable cells |\n| `func expandableTableView(_ expandableTableView: ExpandableTableView, heightsForExpandedRowAt indexPath: IndexPath) -\u003e [CGFloat]?` | Key method to get expandable cells's height |\n\n| Required UITableViewDelegate, UITableViewDataSource | Explanation |\n| --------------------------------------------------- | ----------- |\n| `func expandableTableView(_ expandableTableView: ExpandableTableView, cellForRowAt indexPath: IndexPath) -\u003e UITableViewCell` | - |\n| `func expandableTableView(_ expandableTableView: ExpandableTableView, numberOfRowsInSection section: Int) -\u003e Int` | - |\n| `func expandableTableView(_ expandableTableView: ExpandableTableView, heightForRowAt indexPath: IndexPath) -\u003e CGFloat` | - |\n\n### Advanced\n#### ExpandableTableView property\n| Property | Type | Explanation |\n| -------- | ---- | ----------- |\n| `animation` | `UITableViewRowAnimation` | Animation when open and close | \n| `expansionStyle` | `ExpandableTableView.ExpansionStyle` | Select expansion type:\u003cbr\u003e**single** - one row at a time;\u003cbr\u003e**singlePerSection** - one row at a time, per section;\u003cbr\u003e**multi** - any number of rows at a time|\n| `autoRemoveSelection` | `Bool` | autoRemoveSelection __true__ means the cell will flicker selected, and autoRemoveSelection __false__ means the default selection behaviour of the tableview will apply (single or multi selection) | \n\n#### ExpandableTableView methods\n| Method | Explanation |\n| ------ | ----------- |\n| `openAll` | Open all that you set in `func expandableTableView(_ expandableTableView: ExpandableTableView, expandedCellsForRowAt indexPath: IndexPath) -\u003e [UITableViewCell]?` |\n| `closeAll` | Close all that you set in `func expandableTableView(_ expandableTableView: ExpandableTableView, expandedCellsForRowAt indexPath: IndexPath) -\u003e [UITableViewCell]?` |\n| `reloadData` | TableView reload data. Expanded cells will be work also |\n| `open(at indexPath: IndexPath)` | Open specific indexPath |\n\n#### Optional delegates\n| Optional ExpandableDelegate | Explanation |\n| --------------------------- | ----------- |\n| `func expandableTableView(_ expandableTableView: ExpandableTableView, didSelectExpandedRowAt indexPath: IndexPath)` | Get indexpath in expanded row |\n| `func expandableTableView(_ expandableTableView: ExpandableTableView, expandedCell: UITableViewCell, didSelectExpandedRowAt indexPath: IndexPath)` | Get expandedCell and indexPath |\n\n\n| Optional UITableViewDelegate, UITableViewDataSource | Explanation |\n| --------------------------------------------------- | ----------- |\n| `func expandableTableView(_ expandableTableView: ExpandableTableView, didSelectRowAt indexPath: IndexPath)` | - | \n| `func expandableTableView(_ expandableTableView: ExpandableTableView, titleForHeaderInSection section: Int) -\u003e String?` | - |\n| `func expandableTableView(_ expandableTableView: ExpandableTableView, heightForHeaderInSection section: Int) -\u003e CGFloat` | - |\n| `func expandableTableView(_ expandableTableView: ExpandableTableView, viewForHeaderInSection section: Int) -\u003e UIView?` | - |\n| `func numberOfSections(in expandableTableView: ExpandableTableView) -\u003e Int` | - |\n| `func expandableTableView(_ expandableTableView: ExpandableTableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath)` | - |\n| `func expandableTableView(_ expandableTableView: ExpandableTableView, willDisplayHeaderView view: UIView, forSection section: Int)` | - |\n| `func expandableTableView(_ expandableTableView: ExpandableTableView, willDisplayFooterView view: UIView, forSection section: Int)` | - |\n\n#### For arrow effect\nInherit `ExpandableCell` when you need arrow effect or change arrow image\n```swift\nopen class ExpandableCell: UITableViewCell {\n    open var arrowImageView: UIImageView!\n}\n```\n\n#### For highlight animation\nInherit `ExpandableCell` when you need disable or enable highlight animation\n```swift\nopen class ExpandableCell: UITableViewCell {\n    open var highlightAnimation = HighlightAnimation.animated\n}\n```\n\n#### Adding right margin to arrow icon\nInherit `ExpandableCell` when you need right margin ( Default margin is 16 )\n```swift\nopen class ExpandableCell: UITableViewCell {\n    open var rightMargin: CGFloat = 16\n}\n```\n\nSet tableview insert animation\n```Swift\ntableView.animation = .automatic\n```\n\nMake protocols in `ExpandableDelegate` if you need or make pull request to me :)\n\n#### ExpandableCell methods\n\n| ExpandableCell methods | Explanation |\n| --------------------------- | ----------- |\n| `isExpanded()` | Check if cell is expanded or not |\n| `isInitiallyExpanded()` | Make cell be open when the tableView content first appears in the view |\n| `isSelectable()` | Make cell be selectable or not, regardless of tableView selectionStyle |\n\n## Requirements\n`ExpandableCell` written in Swift 5.0. Compatible with iOS 8.0+\n\n## Installation\n\n### Cocoapods\n\nExpandableCell is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'ExpandableCell'\n```\n### Carthage\n```\ngithub \"younatics/ExpandableCell\"\n```\n\n## References\n#### Please tell me or make pull request if you use this library in your application :) \n\n## Author\n[younatics](https://twitter.com/younatics)\n\u003ca href=\"http://twitter.com/younatics\" target=\"_blank\"\u003e\u003cimg alt=\"Twitter\" src=\"https://img.shields.io/twitter/follow/younatics.svg?style=social\u0026label=Follow\"\u003e\u003c/a\u003e\n\n## License\nExpandableCell is available under the MIT license. See the LICENSE file for more info.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyounatics%2Fexpandablecell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyounatics%2Fexpandablecell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyounatics%2Fexpandablecell/lists"}