{"id":18271291,"url":"https://github.com/gcamp/GCRetractableSectionController","last_synced_at":"2025-04-05T01:31:17.826Z","repository":{"id":140477424,"uuid":"1648234","full_name":"gcamp/GCRetractableSectionController","owner":"gcamp","description":"Controller that helps the management of UITableViews extendable sections","archived":false,"fork":false,"pushed_at":"2013-02-14T21:55:11.000Z","size":215,"stargazers_count":335,"open_issues_count":3,"forks_count":54,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-03-24T11:56:54.175Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gcamp.png","metadata":{"files":{"readme":"README.textile","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-04-22T03:02:28.000Z","updated_at":"2024-12-18T11:57:33.000Z","dependencies_parsed_at":"2023-03-11T22:07:09.282Z","dependency_job_id":null,"html_url":"https://github.com/gcamp/GCRetractableSectionController","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/gcamp%2FGCRetractableSectionController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcamp%2FGCRetractableSectionController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcamp%2FGCRetractableSectionController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcamp%2FGCRetractableSectionController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gcamp","download_url":"https://codeload.github.com/gcamp/GCRetractableSectionController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276043,"owners_count":20912286,"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-11-05T11:39:12.152Z","updated_at":"2025-04-05T01:31:12.808Z","avatar_url":"https://github.com/gcamp.png","language":"Objective-C","readme":"h1. GCRetractableSectionController\n\nGCRetractableSectionController is an helper class that let you make easily section of @UITableView@ that detract and contract when tapped.\n\n!http://s3.amazonaws.com/cocoacontrols_production/ios_screens/97/full.png?1303498477!\n\nh2. Usage\n\n(See the demo project included)\n\nh3. Creation and customization\n\nFirst thing you need to do is subclass @GCRetractableSectionController@ to have your own section controller. (You can also look at @GCArraySectionController@, a drop-in subclass that you can use right away, available in the demo project.)\n\nThe basics things you need to overwrite are the following. \n\n\u003cpre\u003e\n@property (nonatomic, copy, readonly) NSString* title;\n@property (nonatomic, readonly) NSUInteger contentNumberOfRow;\n- (NSString*) titleContentForRow:(NSUInteger) row;\n\u003c/pre\u003e\n\nThe @title@ property represent the title of the section. The @title@ is shown in the main cell when the section controller is closed. The @contentNumberOfRow@ should return the number of rows of _content_ in your section (the title cell is not content). You also overwrite @titleContentForRow:@ to provide the title of your content cells.\n\nSee the @GCSimpleSectionController@ example in the demo project.\n\nTo react to selection of your content, you should overwrite in your section controller this method.\n\n\u003cpre\u003e\n- (void)didSelectContentCellAtRow:(NSUInteger)row;\n\u003c/pre\u003e\n\nYou can also change have more control on the content of your cells by overwriting the following methods. Look at the @GCCustomSectionController@ in the demo project for more details.\n\n\u003cpre\u003e\n- (UITableViewCell *)cellForRow:(NSUInteger)row;\n- (UITableViewCell *)titleCell;\n- (UITableViewCell *)contentCellForRow:(NSUInteger)row;\n\u003c/pre\u003e\n\nh3. UITableView's dataSource usage\n\nWhen your @GCRetractableSectionController@ is ready, you need to use it in your @UIViewController@.\n\nYou initialize your subclass by providing your @UIViewController@. You @UIViewController@ *must* respond to the 'tableView' selector and return a @UITableView@. You'll probably want to save that section controller as an ivar.\n\n\u003cpre\u003e\nYourSectionController* sectionController = [[YourSectionController alloc] initWithViewController:self];\n\u003c/pre\u003e\n\n@GCRetractableSectionController@ provide simple method for you to use in you @UITableView@ 's dataSource. An example usage follow.\n\n\u003cpre\u003e\n- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {\n    GCRetractableSectionController* sectionController = /*Your section controller ivar*/;\n    return sectionController.numberOfRow;\n}\n\n- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {\n    GCRetractableSectionController* sectionController = /*Your section controller ivar*/;\n    return [sectionController cellForRow:indexPath.row];\n}\n\n- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {\n    GCRetractableSectionController* sectionController = /*Your section controller ivar*/;\n    return [sectionController didSelectCellAtRow:indexPath.row];\n}\n\u003c/pre\u003e\n","funding_links":[],"categories":["etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgcamp%2FGCRetractableSectionController","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgcamp%2FGCRetractableSectionController","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgcamp%2FGCRetractableSectionController/lists"}