{"id":2824,"url":"https://github.com/fastred/ConfigurableTableViewController","last_synced_at":"2025-07-31T12:33:31.869Z","repository":{"id":136456457,"uuid":"48945114","full_name":"fastred/ConfigurableTableViewController","owner":"fastred","description":"Typed, yet Flexible Table View Controller","archived":false,"fork":false,"pushed_at":"2016-10-23T13:17:04.000Z","size":128,"stargazers_count":269,"open_issues_count":2,"forks_count":25,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-29T00:23:25.100Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://holko.pl/2016/01/05/typed-table-view-controller/","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/fastred.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}},"created_at":"2016-01-03T12:38:30.000Z","updated_at":"2023-03-13T03:25:10.000Z","dependencies_parsed_at":"2024-01-27T01:27:32.259Z","dependency_job_id":null,"html_url":"https://github.com/fastred/ConfigurableTableViewController","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastred%2FConfigurableTableViewController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastred%2FConfigurableTableViewController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastred%2FConfigurableTableViewController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastred%2FConfigurableTableViewController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fastred","download_url":"https://codeload.github.com/fastred/ConfigurableTableViewController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228248431,"owners_count":17891447,"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":[],"created_at":"2024-01-05T20:16:23.813Z","updated_at":"2024-12-05T06:31:22.154Z","avatar_url":"https://github.com/fastred.png","language":"Swift","funding_links":[],"categories":["UI"],"sub_categories":["Table View / Collection View","Layout","Other free courses"],"readme":"# ConfigurableTableViewController\n\nSimple view controller that provides a way to configure a table view with multiple types of cells while keeping type safety. To learn what and whys I encourage you to read the [associated blog post][blog-post].\n\n## Usage\n\nLet's say we want to present a table view controller with four rows: two with text and two with images. We start by creating view data structures that cells will be configurable with:\n\n```swift\nstruct TextCellViewData {\n    let title: String\n}\n\nstruct ImageCellViewData {\n    let image: UIImage\n}\n```\n\nand the cells themselves:\n\n```swift\nclass TextTableViewCell: UITableViewCell {\n    func updateWithViewData(viewData: TextCellViewData) {\n        textLabel?.text = viewData.title\n    }\n}\n\nclass ImageTableViewCell: UITableViewCell {\n    func updateWithViewData(viewData: ImageCellViewData) {\n        imageView?.image = viewData.image\n    }\n}\n```\n\nNow to present a table view controller with those cells, we simply configure it in the following way:\n\n```swift\nimport ConfigurableTableViewController\n\n...\n\nlet viewController = ConfigurableTableViewController(items: [\n    CellConfigurator\u003cTextTableViewCell\u003e(viewData: TextCellViewData(title: \"Foo\")),\n    CellConfigurator\u003cImageTableViewCell\u003e(viewData: ImageCellViewData(image: apple)),\n    CellConfigurator\u003cImageTableViewCell\u003e(viewData: ImageCellViewData(image: google)),\n    CellConfigurator\u003cTextTableViewCell\u003e(viewData: TextCellViewData(title: \"Bar\")),\n    ])\n\npresentViewController(viewController, animated: true, completion: nil)\n```\n\nAnd ta-da :balloon::\n\n\u003cimg src=\"https://raw.githubusercontent.com/fastred/ConfigurableTableViewController/master/demo.png?token=AAMEh9MRg_K2gNrcJ8DAmqvpQaHRwNGlks5WkrCNwA%3D%3D\" width=\"300\"\u003e\n\nI encourage you to check both the [implementation][Framework] and an [example app][ExampleApp].\n\n## Demo\n\nTo run the example project; clone the repo, open the project and run `ExampleApp` target.\n\n## Requirements\n\niOS 8 and above.\n\n## Author\n\nArkadiusz Holko:\n\n* [Blog](http://holko.pl/)\n* [@arekholko on Twitter](https://twitter.com/arekholko)\n\n [Framework]: https://github.com/fastred/ConfigurableTableViewController/tree/master/Framework\n [ExampleApp]: https://github.com/fastred/ConfigurableTableViewController/tree/master/ExampleApp\n [blog-post]: http://holko.pl/2016/01/05/typed-table-view-controller/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastred%2FConfigurableTableViewController","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastred%2FConfigurableTableViewController","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastred%2FConfigurableTableViewController/lists"}