{"id":50200865,"url":"https://github.com/partho-maple/PBTreeView","last_synced_at":"2026-06-11T14:00:35.479Z","repository":{"id":268884456,"uuid":"87823159","full_name":"partho-maple/PBTreeView","owner":"partho-maple","description":"An UITreeView implementation from UITableView that Apple missed in its UIKit framework. And it is in pure Swift.","archived":false,"fork":false,"pushed_at":"2019-07-02T01:31:50.000Z","size":6522,"stargazers_count":138,"open_issues_count":3,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-19T14:22:11.064Z","etag":null,"topics":["dynamic","ios","ios-component","ios-swift","swift","swift5","tree-structure","treeview","ui-components","uikit","uikit-framework","uitableview","uitableview-subclass","uitreeview"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/partho-maple.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-10T14:51:05.000Z","updated_at":"2023-07-18T11:43:17.000Z","dependencies_parsed_at":"2024-12-19T14:22:15.636Z","dependency_job_id":null,"html_url":"https://github.com/partho-maple/PBTreeView","commit_stats":null,"previous_names":["partho-maple/pbtreeview"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/partho-maple/PBTreeView","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/partho-maple%2FPBTreeView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/partho-maple%2FPBTreeView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/partho-maple%2FPBTreeView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/partho-maple%2FPBTreeView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/partho-maple","download_url":"https://codeload.github.com/partho-maple/PBTreeView/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/partho-maple%2FPBTreeView/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34201842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"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":["dynamic","ios","ios-component","ios-swift","swift","swift5","tree-structure","treeview","ui-components","uikit","uikit-framework","uitableview","uitableview-subclass","uitreeview"],"created_at":"2026-05-25T22:00:42.189Z","updated_at":"2026-06-11T14:00:35.458Z","avatar_url":"https://github.com/partho-maple.png","language":"Swift","funding_links":[],"categories":["Developer Tools \u0026 Libraries"],"sub_categories":["🚀 How to contribute"],"readme":"# PBTreeView\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://developer.apple.com/swift/\" target=\"_blank\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/Swift-5.0-orange.svg?style=flat\" alt=\"Swift 5.0\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://developer.apple.com/swift/\" target=\"_blank\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/Platforms-OS%20X%20%7C%20Linux%20-lightgray.svg?style=flat\" alt=\"iOS\"\u003e\n\u003c/a\u003e\n\u003ca href=\"http://perfect.org/licensing.html\" target=\"_blank\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/License-Apache-lightgrey.svg?style=flat\" alt=\"License Apache\"\u003e\n\u003c/a\u003e\n\u003ca href=\"http://twitter.com/ParthoBiswas007\" target=\"_blank\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/Twitter-@ParthoBiswas007-blue.svg?style=flat\" alt=\"PerfectlySoft Twitter\"\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n----------\n\nAn UITreeView implementation from UITableView that Apple missed in its UIKit framework. And it is in pure Swift.\n\n\u003cp align=\"center\" \u003e★★ \u003cb\u003eStar our github repository to help us!\u003c/b\u003e ★★\u003c/p\u003e\n\u003cp align=\"center\" \u003eCreated by \u003ca href=\"http://parthobiswas.com/\"\u003ePartho Biswas\u003c/a\u003e (\u003ca href=\"http://www.twitter.com/ParthoBiswas007\"\u003e@ParthoBiswas007\u003c/a\u003e)\u003c/p\u003e\n\n## What's in it\n\n- [x] An UITreeView implementation from UITableView.\n- [x] An iOS application showing it's implementation and usage.\n\n## Preview\n![preview](/Preview.gif?raw=true)  \n\n## Requirements\n\niOS 8.0+ / Swift 5.0+\n\n## Setup and Usage\nThis `PBTreeView` has been drawn over `UITableView`. Every row/node of the TreeView represents a `UITableViewCell` with a custom object.\n\n\n\u003e Step 1:\n* First you need to arrange some datasource that seems like a tree. Check this [JSON datasource](https://github.com/partho-maple/PBTreeView/blob/master/PBTreeVIew/PBTreeVIew/Supporting%20FIles/getRelation.json) as example. \n* This JSON data contains [RelationshipDetails](https://github.com/partho-maple/PBTreeView/blob/master/PBTreeVIew/PBTreeVIew/Classes/Model/JSON/RelationshipDetails.swift) object as primary unit. This object will contain the information for each node of the tree. This object need to have an unique identifire. In this case, it's `social_security_number`.\n\n\u003e Step 2:\n* Create a `TreeViewDataHandler` object and call it's following function passing the parsed data array\n```\npublic func configureTreeViewDatasource(_ relationDetails: [RelationshipDetails]) -\u003e [TreeViewNodeItem]?\n```\nAnd use the return value of the above function as TreeView's data source. Lile following.\n```\nvar dataHandler: TreeViewDataHandler? = TreeViewDataHandler()\n    \nlet relations: [RelationshipDetails]? = readJson(JSON_File_Name)\nvar treeViewDataSource = [TreeViewNodeItem]()\ntreeViewDataSource = (dataHandler?.configureTreeViewDatasource(relations!))!\n```\n\n\u003e Step 3:\n* Listen for `RelodeTreeView` notification to relode the TreeView.\n```\nNotificationCenter.default.addObserver(self, selector: #selector(relodeTreeView(_:)), name: NSNotification.Name(rawValue: \"RelodeTreeView\"), object: nil)\n\nfunc relodeTreeView(_ notification: Notification) {\n  self.treeViewDataSource = (dataHandler?.refreshNodes())!\n  DispatchQueue.main.async {\n    self.famityTreeTableView.reloadData()\n    }\n}\n```\n\n## Customisation\n\n### Setting up `UITableViewCell` and `UITableView`\n* Create your own `UITableViewCell` custom subclass for the TreeView node.\n\n### Setting up custom data model\n* Just replace `Relations` and `RelationshipDetails` object with your own with proper changes and requirments.\n\n## Up Next\n* Dynamic addition and deletion of tree node.\n* Dyanmic Data Container\n* Dynamic View Holder\n\n## Contributing\n\nContributions are welcome. Please just open an Issue on GitHub to discuss a point or request a feature or send a Pull Request with your suggestion. If there's a related discussion on the Swift Evolution mailing list, please also post the thread name with a link.\n\nPlease also try to follow the same syntax and semantic in your **commit messages** (see rationale [here](http://chris.beams.io/posts/git-commit/)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpartho-maple%2FPBTreeView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpartho-maple%2FPBTreeView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpartho-maple%2FPBTreeView/lists"}