{"id":13849244,"url":"https://github.com/ocrickard/OCExpandableButton","last_synced_at":"2025-07-12T16:31:13.277Z","repository":{"id":8543104,"uuid":"10163890","full_name":"ocrickard/OCExpandableButton","owner":"ocrickard","description":"A Sparrow-like expanding toolbar button in CoreAnimation.","archived":false,"fork":false,"pushed_at":"2013-09-24T00:06:21.000Z","size":254,"stargazers_count":401,"open_issues_count":2,"forks_count":50,"subscribers_count":23,"default_branch":"master","last_synced_at":"2024-08-05T19:36:50.717Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ocrickard.png","metadata":{"files":{"readme":"readme.markdown","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":"2013-05-20T01:25:45.000Z","updated_at":"2024-06-13T09:46:25.000Z","dependencies_parsed_at":"2022-08-24T02:50:54.445Z","dependency_job_id":null,"html_url":"https://github.com/ocrickard/OCExpandableButton","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/ocrickard%2FOCExpandableButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocrickard%2FOCExpandableButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocrickard%2FOCExpandableButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocrickard%2FOCExpandableButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ocrickard","download_url":"https://codeload.github.com/ocrickard/OCExpandableButton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225829364,"owners_count":17530663,"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-08-04T19:01:11.808Z","updated_at":"2024-11-22T01:30:41.905Z","avatar_url":"https://github.com/ocrickard.png","language":"Objective-C","readme":"#OCExpandableButton#\n\nOCExpandableButton is a VERY simple component in native Objective C that mimics the behavior of the expanding menu in the Sparrow mail app.  You give it an array of subviews, and it presents them when it's activated.  It is a normal subview, so you're in charge of rotation, and anything extra.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://raw.github.com/rnystrom/OCExpandableButton/master/animation.gif\"/\u003e\u003c/p\u003e\n\n##Usage##\n\nUsage of the control is totally simple, it works just like any other UIView:\n\n```objc\nbutton = [[OCExpandableButton alloc] initWithFrame:CGRectMake(self.view.bounds.size.width - 57, self.view.bounds.size.height - 57, 37, 37) subviews:subviews];\n[self.view addSubview:button];\n```\n\nThe array of subviews will be positioned and aligned upon opening of the control.  The frame for the control should be a square region.  The blue \"arrow\" button will be inset by 4 pixels from this initial rect.\n\nIf you want to manually open/close the component (say the screen rotates, or the user begins to scroll), then you can use the following methods:\n\n```objc\n//Opens the control if the control is currently closed.  No effect if the button\n// is already open.\n- (void)open;\n\n//Closes the control if open.  No effect if already closed.\n- (void)close;\n```\n\nYou can make the component reveal with left or right alignment using:\n```objc\nbutton.alignment = OCExpandableButtonAlignmentLeft;\n```\nor\n```objc\nbutton.alignment = OCExpandableButtonAlignmentRight;\n```\n\nYou can use the delegate property in order to notify of the control's opening/closure.\n\n\t@interface MyClass : NSObject \u003cOCExpandableButtonDelegate\u003e\n\t\t...\n\t@end\n\t\n\t@implementation MyClass\n\t...\n\t- (void)expandableButtonClosed:(OCExpandableButton*)button\n\t{ ... }\n\t- (void)expandableButtonOpened:(OCExpandableButton*)button\n\t{ ... }\n\nTODO:\n\n- Implement inner shadows like they have in Sparrow - Not sure what the right API looks like here.  Maybe just letting user specify images, or maybe using masks and drawing inner shadows manually?\n- Suggestions?\n","funding_links":[],"categories":["Objective-C","etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focrickard%2FOCExpandableButton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focrickard%2FOCExpandableButton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focrickard%2FOCExpandableButton/lists"}