{"id":19049306,"url":"https://github.com/cppforlife/uitableviewdsl","last_synced_at":"2025-09-01T17:45:02.291Z","repository":{"id":4189647,"uuid":"5307794","full_name":"cppforlife/UITableViewDSL","owner":"cppforlife","description":"DSL for creating semi-static UITableViews","archived":false,"fork":false,"pushed_at":"2012-11-24T21:09:07.000Z","size":140,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-20T07:49:21.507Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","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/cppforlife.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}},"created_at":"2012-08-05T23:08:44.000Z","updated_at":"2019-11-04T08:49:07.000Z","dependencies_parsed_at":"2022-08-20T05:00:14.289Z","dependency_job_id":null,"html_url":"https://github.com/cppforlife/UITableViewDSL","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cppforlife/UITableViewDSL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cppforlife%2FUITableViewDSL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cppforlife%2FUITableViewDSL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cppforlife%2FUITableViewDSL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cppforlife%2FUITableViewDSL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cppforlife","download_url":"https://codeload.github.com/cppforlife/UITableViewDSL/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cppforlife%2FUITableViewDSL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273166289,"owners_count":25057175,"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-09-01T02:00:09.058Z","response_time":120,"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":[],"created_at":"2024-11-08T23:10:30.259Z","updated_at":"2025-09-01T17:45:02.262Z","avatar_url":"https://github.com/cppforlife.png","language":"Objective-C","readme":"## Custom DSL for creating semi-static UITableViews\n\nBuild the project to see SimpleTableController use table DSL. \nOr just copy files under Group T into your project to start using it yourself.\n\n```objc\n#import \"TTableController.h\"\n\n@interface SimpleTableController \u003c TTableController\n@end\n\n@implementation SimpleTableController\n\ndefineTable\n    addSection {\n        header = @\"Welcome\";\n\n        addRow {\n            row.memoize = YES;\n            identifier = @\"username\";\n            className = @\"SimpleCell\";\n            text = @\"Username\";\n            customize = ^(SimpleCell *cell){\n                cell.textField.placeholder = @\"required\";\n            };\n        }\n\n        addMemoizedRow(@\"password\", @\"SimpleCell\") {\n            text = @\"Password\";\n            customize = ^(SimpleCell *cell){\n                cell.textField.placeholder = @\"required\";\n            };\n        }\n\n        addMemoizedRow(@\"confirm-password\", @\"SimpleCell\") {\n            text = @\"Confirm\";\n            customize = ^(SimpleCell *cell){\n                cell.textField.placeholder = @\"required\";\n            };\n        }\n    }\n\n    addSection {\n        footer = @\"We will not share your email with anyone.\";\n\n        addRow {\n            identifier = @\"register\";\n            text = @\"Register\";\n            \n            build = ^{\n                return [[[UITableViewCell alloc]\n                         initWithStyle:UITableViewCellStyleDefault\n                         reuseIdentifier:row.identifier] autorelease];\n            };\n            \n            customize = ^(UITableViewCell *cell){\n                cell.textLabel.textAlignment = UITextAlignmentCenter;\n            };\n            \n            onTap = ^{\n                [controller registerUser];\n            };\n        }\n    }\n}\n\n@end\n```\n\n* `TTableController` subclasses UITableViewController\n* `controller` object is available inside defineTable\n  * do not use `self` in blocks in place of `controller` since that would result in a retain cycle\n* `section` object is available inside addSection\n* `row` object is available inside addRow/addMemoizedRow\n* `build` block is called when cell is constructed (so only once)\n* `customize` block is called when cell was just dequeued or built \n* `onTap` is self explanatory\n* you can access memoized cell (by identifier) anywhere inside your controller class \n  after `viewDidLoad` and before `viewDidUnload`\n  * `[[(SimpleCell *)[self memoizedCell:@\"username\"] textField] text]`\n  \n## Todos\n\n* figure out how to add missing opening curly brace for defineTable","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcppforlife%2Fuitableviewdsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcppforlife%2Fuitableviewdsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcppforlife%2Fuitableviewdsl/lists"}