{"id":32312689,"url":"https://github.com/mobileupllc/tableadapter","last_synced_at":"2026-03-06T02:36:51.137Z","repository":{"id":56923603,"uuid":"263932046","full_name":"MobileUpLLC/TableAdapter","owner":"MobileUpLLC","description":"A data-driven library for building complex table views easily","archived":false,"fork":false,"pushed_at":"2020-06-03T14:27:46.000Z","size":230,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-10-23T09:58:56.310Z","etag":null,"topics":["animation","datasource","delegate","diff","diffing","sections","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/MobileUpLLC.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":"2020-05-14T14:05:28.000Z","updated_at":"2025-09-09T08:25:19.000Z","dependencies_parsed_at":"2022-08-20T22:50:20.569Z","dependency_job_id":null,"html_url":"https://github.com/MobileUpLLC/TableAdapter","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/MobileUpLLC/TableAdapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileUpLLC%2FTableAdapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileUpLLC%2FTableAdapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileUpLLC%2FTableAdapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileUpLLC%2FTableAdapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MobileUpLLC","download_url":"https://codeload.github.com/MobileUpLLC/TableAdapter/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileUpLLC%2FTableAdapter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280598944,"owners_count":26357977,"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-10-23T02:00:06.710Z","response_time":142,"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":["animation","datasource","delegate","diff","diffing","sections","tableview"],"created_at":"2025-10-23T09:58:52.427Z","updated_at":"2025-10-23T09:58:57.936Z","avatar_url":"https://github.com/MobileUpLLC.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TableAdapter\n\n\u003cp align=\"left\"\u003e\n    \u003ca href=\"https://developer.apple.com/swift\"\u003e\u003cimg src=\"https://img.shields.io/badge/language-Swift_4.2-green\" alt=\"Swift5\" /\u003e\u003c/a\u003e\n \u003cimg src=\"https://img.shields.io/badge/platform-iOS-blue.svg?style=flat\" alt=\"Platform iOS\" /\u003e\n \u003ca href=\"https://cocoapods.org/pods/tablekit\"\u003e\u003cimg src=\"https://img.shields.io/badge/pod-1.0.0-blue.svg\" alt=\"CocoaPods compatible\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/Carthage/Carthage\"\u003e\u003cimg src=\"https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat\" alt=\"Carthage compatible\" /\u003e\u003c/a\u003e\n \u003ca href=\"https://github.com/MobileUpLLC/TableAdapter/blob/develop/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-green\" alt=\"License: MIT\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nA data-driven library for building complex table views. Easy updating table view items with animations using automatic diffing algorithm under the hood. Our goal is to think in terms of data instead of index paths while building tables. High-level yet flexible api allows to setup sectioned lists in a few lines of code and take more control over the table where it’s needed. And reusable views configuring helps to keep code clean and stable in a type-safe manner.\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/26662065/71070139-31544b00-218b-11ea-9512-5b2c519c0382.gif\" width=\"\" height=\"400\" /\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/26662065/71070318-96a83c00-218b-11ea-9c0f-9015b63225e7.gif\" width=\"\" height=\"400\" /\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/16690973/82672960-bf0bf900-9c49-11ea-9d86-56ba4711d1ae.gif\" width=\"\" height=\"400\" /\u003e\n\u003c/div\u003e\n\n## Features\n\n- Animated table updates based on auto diffing\n- Liner time diffing algorithm\n- Type-safe cell, header/footer setup via protocol implementation\n- No more `dequeReusable...`\n- No need to subclass either cell, table or model\n- Cell initialization from xib, storyboard or code\n- Simple yet flexible sections constructing\n- Easy to extend\n\n## Usage\n\n### 1. Setup models and reusable views\n\n#### 1.1 Model setup\n\nItem for cells must adopt `Hashable` protocol.\n\n#### 1.2 Cells setup\n\nTable view cell should conform to `Configurable` protocol in order to receive cell item for setup.\n\n```swift\nextension Cell: Configurable {\n\n    public func setup(with item: User) {\n\n        textLabel?.text = item.name\n    }\n}\n```\n\n#### 1.3 Header/Footer view setup\n\nHeader/Footer view also should adopt `Configurable` protocol to receive config item provided by `Section`.\n\n```swift\nextension Header: Configurable {\n\n    public func setup(with item: String) {\n\n        textLabel?.text = item\n    }\n}\n```\n\n### 2. Create sections\n\nSection `Section\u003cItem, SectionId\u003e` is generic type and developer should provide cell models type (`Item`) and section id type (`SectionId`). It contains information about items, header/footer config (optionally) and must have unique `id`.\n\n`HeaderFooterConfig` contains all information for section header/footer setup. There are two types of it: for default and custom header/footer view type.\n\n#### 2.1 Default title for header/footer\n\n```swift\nlet section = Section\u003cUser, Int\u003e(\n    id: 0,\n    items: [...],\n    header: .default(title: \"Section Begin\")\n)\n```\n\n#### 2.2 Custom header/footer view\n\n```swift\nlet section = Section\u003cUser, Int\u003e(\n    id: 0,\n    items: [...],\n    header: .custom(item: \"Section Begin\", reuseId: \"FooterId\")\n)\n```\n\n**Node:** any type of item can be used for header/footer setup.\n\n### 3. Create adapter and fill it with section\n\nCreate `TableAdapter\u003cItem, SectionId\u003e`. Item and section id are associated types, like in `Section`.\n\nThen update adapter with sections.\n\n```swift\nclass ViewController: UIViewController {\n\n    let tableView = ...\n\n    let users: [User] = [...]\n\n    private lazy var adapter = TableAdapter\u003cUser, Int\u003e(\n        tableView: tableView,\n        cellIdentifierProvider: { (indexPath, item) -\u003e String? in\n            return \"Cell\"\n        },\n        cellDidSelectHandler: { (table, indexPath, item) in\n            // Handle cell selection for item at indexPath\n        }\n    )\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n\n        setupTable()\n\n        let section = Section\u003cUser, Int\u003e(\n            id: 0,\n            items: users,\n            header: .custom(item: \"Begin\", reuseId: \"HeaderId\"),\n            footer: .custom(item: \"End\", reuseId: \"FooterId\"),\n        )\n\n        adapter.update(with: [section], animated: true)\n    }\n\n    func setupTable() {\n        tableView.register(Cell.self, forCellReuseIdentifier: \"Cell\")\n\n        tableView.register(Header.self, forHeaderFooterViewReuseIdentifier identifier: \"HeaderId\")\n        tableView.register(Footer.self, forHeaderFooterViewReuseIdentifier identifier: \"FooterId\")\n    }\n}\n```\n\n**Note**: this adapter type sets table view delegate to itself. To handle other table view delegate methods, you must inherit `TableAdapter` and implement them.\n\nYou can also obtain current adapter sections unisng `currentSections: [Section]` variable.\n\n## Sender\n\nSometimes you need to set delegate for cell, header or footer. For that purpose table adapter has `sender` property, which will be passed to configurable view, that adopts `SenderConfigurable` protocol.\n\n```swift\nextension Cell: SenderConfigurable {\n\n    func setup(with item: Item, sender: ViewController) {\n\n        textLabel?.text = object.name\n        delegate = sender\n    }\n}\n```\n\n## One cell type\n\nTo use only one cell type, create adapter **without** `CellReuserIdentifierProvider`\n\n```swift\nlazy var adapter = TableAdapter\u003cUser, Int\u003e(tableView: tableView)\n ```\n\nand register cell via storyboard or code for default cell reuse identifier, which is \"Cell\" under the hood\n\n ```swift\ntableView.register(Cell.self, forCellReuseIdentifier: adapter.defaultCellIdentifier)\n ```\n\n## Requirements\n\n- Swift 4.2+\n- iOS 9.0+\n\n## Installation\n\n### CocoaPods\n\nAdd the following to `Podfile`:\n\n```ruby\npod 'TableAdapter'\n```\n\n### Carthage\n\nAdd the following to `Cartfile`:\n\n```ruby\ngithub \"MobileUpLLC/TableAdapter\"\n```\n\n### Manual\n\nDownload and drag files from Source folder into your Xcode project.\n\n## License\n\nTableAdapter is distributed under the [MIT License](https://github.com/MobileUpLLC/TableAdapter/blob/develop/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobileupllc%2Ftableadapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmobileupllc%2Ftableadapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobileupllc%2Ftableadapter/lists"}