{"id":13463473,"url":"https://github.com/bfeher/BFPaperCheckbox","last_synced_at":"2025-03-25T06:32:01.241Z","repository":{"id":18970213,"uuid":"22191104","full_name":"bfeher/BFPaperCheckbox","owner":"bfeher","description":"iOS Checkboxes inspired by Google's Paper Material Design.","archived":false,"fork":false,"pushed_at":"2017-02-23T05:53:54.000Z","size":2157,"stargazers_count":428,"open_issues_count":4,"forks_count":42,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-06T23:18:55.578Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bfeher.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-24T01:23:34.000Z","updated_at":"2024-09-04T13:38:11.000Z","dependencies_parsed_at":"2022-09-05T22:40:37.691Z","dependency_job_id":null,"html_url":"https://github.com/bfeher/BFPaperCheckbox","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfeher%2FBFPaperCheckbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfeher%2FBFPaperCheckbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfeher%2FBFPaperCheckbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfeher%2FBFPaperCheckbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bfeher","download_url":"https://codeload.github.com/bfeher/BFPaperCheckbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245414348,"owners_count":20611358,"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-07-31T13:00:54.040Z","updated_at":"2025-03-25T06:32:00.884Z","avatar_url":"https://github.com/bfeher.png","language":"Objective-C","readme":"BFPaperCheckbox\n=============\n[![CocoaPods](https://img.shields.io/cocoapods/v/BFPaperCheckbox.svg?style=flat)](https://github.com/bfeher/BFPaperCheckbox)\n\n\u003e iOS Checkboxes inspired by Google's Paper Material Design. \n\n![Animated Screenshot](https://raw.githubusercontent.com/bfeher/BFPaperCheckbox/master/BFPaperCheckboxDemoGif.gif \"Animated Screenshot\")\n\n\nAbout\n---------\n### Now with Interface Builder customization support!\n\n_BFPaperCheckbox_ is a subclass of UIControl that behaves much like the new paper checkboxes from Google's Material Design Labs.\nAll animation are asynchronous and are performed on sublayers.\nBFPaperCheckboxes work right away with pleasing default behaviors, however they can be easily customized! The checkmark color and tap-circle color, both positive and negative (for checked and unchecked) are all readily customizable via public properties.\nYou can also set whether or not the tap-circle should appear from the location of the tap, or directly from the center of the control.\n\nBy default, BFPaperCheckboxes use \"Smart Color\" which will match the tap-circle's positive color to the color of the checkmark (`.checkmarkColor`).\nYou can set your own colors via: `.positiveColor` and `.negativeColor`. Note that setting these disables Smart Color functionality.\n\n*Note: Try not to use super slow animation times. It breaks the visual effects (not the functionality though) plus, why would you?*\n\n\n## Properties\n`BOOL isChecked` \u003cbr /\u003e\n\u003e A BOOL representing the state of the checkbox. YES means checked, NO means unchecked.  \n\n`CGFloat touchDownAnimationDuration` \u003cbr /\u003e\n\u003e(Go Steelers!) A CGFLoat representing the duration of the animations which take place on touch DOWN! Default is 0.25f seconds. Note that negative values will be converted to the default. NO FUNNY BUSINESS!  \n\n`CGFloat touchUpAnimationDuration` \u003cbr /\u003e\n\u003eA CGFLoat representing the duration of the animations which take place on touch UP! Default is 2 * touchDownAnimationDuration seconds. Note that negative values will be converted to the default. NO FUNNY BUSINESS!  \n\n`BOOL rippleFromTapLocation` \u003cbr /\u003e\n\u003eA flag to set to YES to have the tap-circle ripple from point of touch. If this is set to NO, the tap-circle will always ripple from the center of the button. Default is NO.  \n\n`UIColor *checkmarkColor` \u003cbr /\u003e\n\u003eA UIColor to use for the checkmark color. Note that `self.tintColor` will be used for the square box color.  \n\n`UIColor *positiveColor` \u003cbr /\u003e\n\u003eThe UIColor to use for the circle which appears where you tap to check the box. Default value is smartly calculated from the `.checkmarkColor` property. Set to nil to access default. Alpha values less than 1 are recommended.  \n\n`UIColor *negativeColor` \u003cbr /\u003e\n\u003eThe UIColor to use for the circle which appears where you tap to uncheck the box. Default value is smartly calculated from the `.tintColor` property. Set to nil to access default. Alpha values less than 1 are recommended.  \n\n`CGFloat cornerRadius` \u003cbr /\u003e\n\u003eThe CGFloat value representing the corner radius of the control. Default value is (bfPaperCheckboxDefaultDiameter / 2). Note that negative values will be converted to 0. NO FUNNY BUSINESS!  \n\n`CGFloat startDiameter` \u003cbr /\u003e\n\u003eA CGFLoat representing the diameter of the tap-circle as soon as it spawns, before it grows. Default is 1.f. Note that negative values and values less than 1 will be converted to the default. NO FUNNY BUSINESS!  \n\n`CGFloat endDiameter` \u003cbr /\u003e\n\u003eThe CGFloat value representing the Diameter of the tap-circle. By default it will take up the entire checkbox background circle. Note that zero and negative values will be converted to the default. NO FUNNY BUSINESS!  \n\n`CGFloat burstAmount` \u003cbr /\u003e\n\u003eThe CGFloat value representing how much we should increase the diameter of the tap-circle by when we burst it. Default is 0 because we can't see a burst with the default `.tapCircleDiameter` which takes up the entire frame. If you want to see a burst, make the `.tapCircleDiameter` something smaller than the diameter of the control itself. Note that negative values will be converted to the default. NO FUNNY BUSINESS!  \n\n`id \u003cBFPaperCheckboxDelegate\u003e delegate` \u003cbr /\u003e\n\u003eA delegate to use our protocol with! The functions it conforms to are detailed below.  \n\n\n## Delegate Functions\n`(void)paperCheckboxChangedState:(BFPaperCheckbox *)checkbox`\u003cbr /\u003e\n\u003eAn optional protocol method for detecting when the checkbox state changed. You can check its current state here with `checkbox.isChecked`.\n\n\n## Constant\n`CGFloat const bfPaperCheckboxDefaultDiameter`\u003cbr /\u003e\n\u003eA nice recommended value for size (49 points). (eg. `[[BFPaperCheckbox alloc] initWithFrame:CGRectMake(x, y, bfPaperCheckboxDefaultDiameter, bfPaperCheckboxDefaultDiameter)];`)\n\n\n## Utility Functions (programmatically set state)\n`(void)switchStatesAnimated:(BOOL)animated`\u003cbr /\u003e\n\u003eUse this function to manually/programmatically switch the state of this checkbox.\n\u003e@param `animated` A BOOL flag to choose whether or not to animate the change.\n\n`(void)checkAnimated:(BOOL)animated`\u003cbr /\u003e\n\u003eUse this function to manually check the checkbox. Does nothing if already checked.\n\u003e@param `animated` A BOOL flag to choose whether or not to animate the change.  \n\n`(void)uncheckAnimated:(BOOL)animated`\u003cbr /\u003e\n\u003eUse this function to manually uncheck the checkbox. Does nothing if already unchecked.\n\u003e@param `animated` A BOOL flag to choose whether or not to animate the change.\n\n\n\nUsage\n---------\nAdd the _BFPaperCheckbox_ header and implementation file to your project. (.h \u0026 .m)\n\n### Creating a nice default BFPaperCheckbox\n```objective-c\nBFPaperCheckbox *paperCheckbox = [[BFPaperCheckbox alloc] initWithFrame:CGRectMake(x, y, bfPaperCheckboxDefaultDiameter, bfPaperCheckboxDefaultDiameter)];\n```\n\n### Customized Example\n```objective-c\nself.programmaticPaperCheckbox = [[BFPaperCheckbox alloc] initWithFrame:CGRectMake(0, 0, bfPaperCheckboxDefaultDiameter, bfPaperCheckboxDefaultDiameter)];\nself.programmaticPaperCheckbox.delegate = self;\nself.programmaticPaperCheckbox.tintColor = [UIColor colorWithRed:97.f/255.f green:97.f/255.f blue:97.f/255.f alpha:1];\nself.programmaticPaperCheckbox.touchUpAnimationDuration = 0.5f;\nself.programmaticPaperCheckbox.touchDownAnimationDuration = 0.5f;\nself.programmaticPaperCheckbox.rippleFromTapLocation = YES;\nself.programmaticPaperCheckbox.checkmarkColor = [UIColor blueColor];\nself.programmaticPaperCheckbox.positiveColor = [[UIColor greenColor] colorWithAlphaComponent:0.5f];\nself.programmaticPaperCheckbox.negativeColor = [[UIColor redColor] colorWithAlphaComponent:0.5f];\nself.programmaticPaperCheckbox.startDiameter = 10;\nself.programmaticPaperCheckbox.endDiameter = 35;\nself.programmaticPaperCheckbox.burstAmount = 10;\n[self.view addSubview:self.programmaticPaperCheckbox];\n```\n\n### Setting states manually\n\u003e Toggle with 'switchStates...'  \n```objective-c\n[self.paperCheckbox switchStatesAnimated:animate];\n```  \n\n\u003e Manually check or uncheck:  \n```objective-c\nif (self.paperCheckbox.isChecked) {\n  [self.paperCheckbox uncheckAnimated:animate];\n} else {\n  [self.paperCheckbox checkAnimated:animate];\n}  \n```  \n\nCocoaPods\n-------\n\nCocoaPods are the best way to manage library dependencies in Objective-C projects.\nLearn more at http://cocoapods.org\n\nAdd this to your podfile to add BFPaperCheckbox to your project.\n```ruby\nplatform :ios, '7.0'\npod 'BFPaperCheckbox'\n```\n\n\nLicense\n--------\n_BFPaperCheckbox_ uses the MIT License:\n\n\u003e Please see included [LICENSE file](https://raw.githubusercontent.com/bfeher/BFPaperCheckbox/master/LICENSE.md).\n","funding_links":[],"categories":["etc","Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfeher%2FBFPaperCheckbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbfeher%2FBFPaperCheckbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfeher%2FBFPaperCheckbox/lists"}