{"id":15037502,"url":"https://github.com/jadhavp/jexpandabletableview","last_synced_at":"2025-04-09T23:24:09.332Z","repository":{"id":56915849,"uuid":"88036411","full_name":"jadhavp/JExpandableTableView","owner":"jadhavp","description":"JExpandableTableView provides out of box support for expandable table cells","archived":false,"fork":false,"pushed_at":"2018-02-06T09:35:51.000Z","size":956,"stargazers_count":54,"open_issues_count":6,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-09T21:24:35.094Z","etag":null,"topics":["expandable-cells","ios","swift3","tableview"],"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/jadhavp.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-04-12T09:50:30.000Z","updated_at":"2024-04-20T20:32:31.000Z","dependencies_parsed_at":"2022-08-20T21:20:24.275Z","dependency_job_id":null,"html_url":"https://github.com/jadhavp/JExpandableTableView","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jadhavp%2FJExpandableTableView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jadhavp%2FJExpandableTableView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jadhavp%2FJExpandableTableView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jadhavp%2FJExpandableTableView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jadhavp","download_url":"https://codeload.github.com/jadhavp/JExpandableTableView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248127104,"owners_count":21052179,"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":["expandable-cells","ios","swift3","tableview"],"created_at":"2024-09-24T20:34:50.035Z","updated_at":"2025-04-09T23:24:09.303Z","avatar_url":"https://github.com/jadhavp.png","language":"Swift","readme":"# JExpandableTableView\nJExpandableTableView provides out of box support for expandable table cells\n\n## Example\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## App Preview ( Checkout [live example app](https://appetize.io/embed/pa5850fv541uff63va4dxtcjrw?device=iphone7\u0026scale=75\u0026orientation=portrait\u0026osVersion=10.3): courtesy Appetize ) \n![](https://github.com/jadhavp/JExpandableTableView/blob/master/Example/preview.gif)\n![](https://github.com/jadhavp/JExpandableTableView/blob/master/Example/Screen_Shot_3.png)\n\n## Requirements\n* Xcode 8.x\n* Swift 3.x\n* iOS 8.0\n\n## Installation\n\nJExpandableTableView is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"JExpandableTableView\"\n```\n## Features\n* Expandable cells\n* Allows to fetch cells asynchronously (refer tableView(_ tableView: JExpandableTableView, numberOfRowsInSection section: Int, callback:  @escaping (Int) -\u003e Void) method in Example)\n* Multple configaration for cell expansion and collapse\n* Easy integration through xib\n* Highly customizable - JExpandableTableView accepts any Header view and Custom cells which makes it very customizable similar to UITableView\n\n## Code Integration\nCreating instance \n* Using interface builder, set class of any UIView to JExpandableTableView \u0026 create outlet in respective viewcontroller\n```swift\n    @IBOutlet weak var jtableView: JExpandableTableView!\n```\n* Using interface builder, set class of any UIView to JExpandableTableView \u0026 create outlet in respective viewcontroller\n```swift\n    jtableView = JExpandableTableView(frame: \u003c#T##CGRect#\u003e)\n```\nAssign delegates, smilar to UITableView delegate\n```swift\n        jtableView.delegate = self\n        jtableView.dataSource = self\n```\nSample delegate methods given below, please refer Example app to get more information.\n```swift\n    func tableView(_ tableView: JExpandableTableView, numberOfRowsInSection section: Int, callback:  @escaping (Int) -\u003e Void) {\n\n        let sectionInfo = self.dataArray[section]\n\n        if sectionInfo.cells.count != 0 {\n            callback(sectionInfo.cells.count)\n        }else{\n            \n            tableView.isUserInteractionEnabled = false\n            SVProgressHUD.show(withStatus: \"Loading chapters...\")\n            \n            DispatchQueue.global().async {\n                \n                Thread.sleep(forTimeInterval: 2)\n                DispatchQueue.main.sync {\n                    tableView.isUserInteractionEnabled = true\n                    SVProgressHUD.dismiss()\n                    let sectionInfo = self.dataArray[section]\n                    sectionInfo.cells.append(CellInfo(\"1. Prologue \",cellId: \"TextCell\"))\n                    sectionInfo.cells.append(CellInfo(\"2. Bran I\",cellId: \"TextCell\"))\n                    sectionInfo.cells.append(CellInfo(\"3. Catelyn I\",cellId: \"TextCell\"))\n                    sectionInfo.cells.append(CellInfo(\"4. Daenerys I\",cellId: \"TextCell\"))\n                    sectionInfo.cells.append(CellInfo(\"5.  A Game of Thrones, very very long chapter beyond the wall\",cellId: \"TextCell\"))\n                    \n                    callback(sectionInfo.cells.count)\n                    \n                }\n            }\n        }\n    }\n    \n    func tableView(_ tableView: JExpandableTableView, cellForRowAt indexPath: IndexPath) -\u003e UITableViewCell{\n        \n        let section = self.dataArray[indexPath.section]\n        let row = section.cells[indexPath.row]\n\n        let cellId = row.cellId\n        let cell = tableView.dequeueReusableCell(withIdentifier: cellId!, for: indexPath)\n    \n        cell.contentView.backgroundColor = UIColor.white\n        let label = cell.viewWithTag(11) as? UILabel\n        label?.text = row.text\n        return cell\n    }\n    \n    func numberOfSections(in tableView: JExpandableTableView) -\u003e Int {\n        \n        return dataArray.count\n    }\n    \n    func tableView(_ tableView: JExpandableTableView, viewForHeaderInSection section: Int) -\u003e UIView? {\n        \n        let section = self.dataArray[section]\n        let header = tableView.dequeueReusableHeaderFooterView(withIdentifier: \"HeaderView\")\n        header?.contentView.backgroundColor = UIColor.groupTableViewBackground\n        let label = header?.viewWithTag(11) as? UILabel\n        label?.text = section.title\n        return header\n    }\n```\n\n### Manually open/close Headers\nBelow code snippet copied from sample app, which demonstrate this feature\n```swift\n        jtableView.openHeader(section: 1);\n        DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(4), execute: {\n            jtableView.closeHeader(section: 1);\n\n        })\n```\n\n### Support UIRefreshControl\n```swift\n    jtableView.addRefreshControler(refreshControl: \u003cUIRefreshControl\u003e)\n```\n\n## Contributing\n\nIf anyone interested in new additions to this repo please feel free to create pull request.\n\n## Author\n\nPramod Jadhav\n\n## License\n\nJExpandableTableView 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%2Fjadhavp%2Fjexpandabletableview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjadhavp%2Fjexpandabletableview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjadhavp%2Fjexpandabletableview/lists"}