{"id":2147,"url":"https://github.com/Boris-Em/BEMCheckBox","last_synced_at":"2025-08-03T00:31:47.042Z","repository":{"id":1758263,"uuid":"41844416","full_name":"Boris-Em/BEMCheckBox","owner":"Boris-Em","description":"Tasteful Checkbox for iOS. (Check box)","archived":false,"fork":false,"pushed_at":"2023-08-03T23:24:15.000Z","size":3572,"stargazers_count":2627,"open_issues_count":27,"forks_count":293,"subscribers_count":46,"default_branch":"master","last_synced_at":"2025-07-26T15:57:33.478Z","etag":null,"topics":["checkbox","checkmark","ios","ui"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/Boris-Em.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-09-03T05:58:18.000Z","updated_at":"2025-07-24T08:53:18.000Z","dependencies_parsed_at":"2023-10-20T18:34:35.368Z","dependency_job_id":null,"html_url":"https://github.com/Boris-Em/BEMCheckBox","commit_stats":{"total_commits":169,"total_committers":19,"mean_commits":8.894736842105264,"dds":"0.21893491124260356","last_synced_commit":"a3292ebae9f0c2737b0c90281219dced2ce51ac8"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/Boris-Em/BEMCheckBox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Boris-Em%2FBEMCheckBox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Boris-Em%2FBEMCheckBox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Boris-Em%2FBEMCheckBox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Boris-Em%2FBEMCheckBox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Boris-Em","download_url":"https://codeload.github.com/Boris-Em/BEMCheckBox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Boris-Em%2FBEMCheckBox/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267220898,"owners_count":24055089,"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-07-26T02:00:08.937Z","response_time":62,"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":["checkbox","checkmark","ios","ui"],"created_at":"2024-01-05T20:16:05.892Z","updated_at":"2025-08-03T00:31:46.602Z","avatar_url":"https://github.com/Boris-Em.png","language":"Swift","funding_links":[],"categories":["Swift","UI","UI Components","OOM-Leaks-Crash"],"sub_categories":["Other free courses","Button","CheckBox","Font","Other Testing"],"readme":"# BEMCheckBox\n[![Build Status](https://travis-ci.org/Boris-Em/BEMCheckBox.svg)](https://travis-ci.org/Boris-Em/BEMCheckBox)\n[![Version](https://img.shields.io/cocoapods/v/BEMCheckBox.svg?style=flat)](http://cocoadocs.org/docsets/BEMCheckBox)\n[![License](https://img.shields.io/cocoapods/l/BEMCheckBox.svg?style=flat)](http://cocoadocs.org/docsets/BEMCheckBox)\n[![Platform](https://img.shields.io/cocoapods/p/BEMCheckBox.svg?style=flat)](http://cocoadocs.org/docsets/BEMCheckBox)\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./.assets/BEMCheckBox logo.jpg\"/\u003e\u003c/p\u003e\t\n\n**BEMCheckBox** is an open source library making it easy to create beautiful, highly customizable, animated checkboxes for iOS. \n\n## Table of Contents\n\n* [**Project Details**](#project-details)  \n  * [Requirements](#requirements)\n  * [License](#license)\n  * [Support](#support)\n  * [Sample App](#sample-app)\n  * [React Native](#react-native)\n  * [NativeScript](#nativescript)\n  * [Xamarin](#xamarin)\n* [**Getting Started**](#getting-started)\n  * [Installation](#installation)\n  * [Setup](#setup)\n* [**Documentation**](#documentation)\n  * [Enabling / Disabling the Checkbox](#enabling--disabling-the-checkbox) \n  * [Reloading](#reloading)\n  * [Group / Radio Button Functionality](#group--radio-button-functionality)\n  * [Delegate](#delegate)\n  * [Customization](#customization)\n\n## Project Details\nLearn more about the **BEMCheckBox** project, licensing, support etc.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./.assets/BEMCheckBox.gif\"/\u003e\u003c/p\u003e\t\n\n### Requirements\n - Requires iOS 7 or later. The sample project is optimized for iOS 9.\n - Requires Automatic Reference Counting (ARC).\n - Optimized for ARM64 Architecture.\n\n### License\nSee the [License](https://github.com/Boris-Em/BEMCheckBox/blob/master/LICENSE). You are free to make changes and use this in either personal or commercial projects. Attribution is not required, but highly appreciated. A little \"Thanks!\" (or something to that affect) is always welcome. If you use **BEMCheckBox** in your app, please let us know!\n\n### Support\n[![Gitter chat](https://badges.gitter.im/Boris-Em/BEMCheckBox.png)](https://gitter.im/Boris-Em/BEMCheckBox)  \nJoin us on [Gitter](https://gitter.im/Boris-Em/BEMCheckBox) if you need any help or want to talk about the project.\n\n### Sample App\nThe iOS Sample App included with this project demonstrates one way to correctly setup and use **BEMCheckBox**. It also offers the possibility to customize the checkbox within the app.\n\n### React Native  \n**BEMCheckBox** can be used with React Native: [React-Native-BEMCheckBox](https://github.com/torifat/react-native-bem-check-box)\n\n### NativeScript  \n**BEMCheckBox** can be used with NativeScript: [NativeScript-BEMCheckBox](https://github.com/nstudio/nativescript-checkbox)\n\n### Xamarin\n**BEMCheckBox** can also be used with Xamarin: [XPlugins.iOS.BEMCheckBox](https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox)\n\n## Getting Started\nIt only takes a few simple steps to install and setup **BEMCheckBox** to your project.\n\n### Installation\n\n#### Swift Package Manager\nAdd `https://github.com/Boris-Em/BEMCheckBox` as a dependency to your Package.swift file or select `File -\u003e Swift Packages -\u003e Add Package Dependency...` in Xcode.\n\n#### CocoaPods\nThe easiest way to install **BEMCheckBox** is to use \u003ca href=\"http://cocoapods.org/\" target=\"_blank\"\u003eCocoaPods\u003c/a\u003e. To do so, simply add the following line to your `Podfile`:\n\t\u003cpre\u003e\u003ccode\u003epod 'BEMCheckBox'\u003c/code\u003e\u003c/pre\u003e\n\n\n#### Carthage\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nRun `carthage update` after adding **BEMCheckBox** to your Cartfile to build the framework. Drag the built `BEMCheckBox.framework` into your Xcode project.\n\n#### Manually\t\nFinally, you can install **BEMCheckBox** manually. Simply drag and drop the *Classes* folder into your Xcode project. When you do so, make sure to check the \"*Copy items into destination group's folder*\" box.\n\n### Setup\nSetting up **BEMCheckBox** to your project couldn't be more simple. It is modeled after `UISwitch`. In fact, you could just replace instances of `UISwitch` by **BEMCheckBox** in your project!  \nHere are the steps to follow to get everything up and running:\n\n 1. Import `\"BEMCheckBox.h\"` to the header of your view controller:\n\n ```objective-c\n #import \"BEMCheckBox.h\"\n ```\n\n 2. **BEMCheckBox** can either be initialized programatically (through code) or with Interface Builder (Storyboard file). Use the method that makes the most sense for your project.\n \n **Programmatical Initialization**  \n Just add the following code to your implementation (usually in the `viewDidLoad` method of your View Controller).\n\n ```objective-c\n BEMCheckBox *myCheckBox = [[BEMCheckBox alloc] initWithFrame:CGRectMake(0, 0, 50, 50)];\n [self.view addSubview:myCheckBox];\n ```\n \n **Interface Builder Initialization**  \n 1 - Drag a `UIView` to your `UIViewController`.  \n 2 - Change the class of the new `UIView` to `BEMCheckBox`.  \n 3 - Select the `BEMCheckBox` and open the Attributes Inspector. Most of the customizable properties can easily be set from the Attributes Inspector. The Sample App demonstrates this capability.\n\n## Documentation\nAll of the methods and properties available for **BEMCheckBox** are documented below.\n\n### Enabling / Disabling the Checkbox\n##### The `on` Property\nJust like `UISwitch`, **BEMCheckBox** provides the boolean property `on` that allows you to retrieve and set (without animation) a value determining wether the BEMCheckBox object is `on` or `off`. Defaults to `NO`.  \nExample usage:\n```objective-c\nself.myCheckBox.on = YES;\n```\n##### `setOn:animated:`\nJust like `UISwitch`, **BEMCheckBox** provides an instance method `setOn:animated:` that sets the state of the checkbox to On or Off, optionally animating the transition.  \nExample usage:\n```objective-c\n[self.myCheckBox setOn:YES animated:YES];\n```\n\n### Reloading\nThe instance method `reload` lets you redraw the entire checkbox, keeping the current `on` value.  \nExample usage:  \n```objective-c\n[self.myCheckBox reload]\n```\n\n### Group / Radio Button Functionality\n**BEMCheckBox**es can easily be grouped together to form radio button functionality. This will automatically manage the state of each checkbox in the group, so that only one is selected at a time, and can optionally require that the group has a selection at all times.\n\n```objective-c\nself.group = [BEMCheckBoxGroup groupWithCheckBoxes:@[self.checkBox1, self.checkBox2, self.checkBox3]];\nself.group.selectedCheckBox = self.checkBox2; // Optionally set which checkbox is pre-selected\nself.group.mustHaveSelection = YES; // Define if the group must always have a selection\n```\n\nTo see which checkbox is selected in that group, just ask for it:\n```objective-c\nBEMCheckBox *selection = self.group.selectedCheckBox;\n```\n\nTo manually update the selection for a group, just set it:\n```objective-c\nself.group.selectedCheckBox = self.checkBox1;\n```\n\n### Delegate\n**BEMCheckBox** uses a delegate to receive check box events. The delegate object must conform to the `BEMCheckBoxDelegate` protocol, which is composed of two optional methods:\n\n- `didTapCheckBox:`  \nSent to the delegate every time the check box gets tapped, after its properties are updated (`on`), but before the animations are completed.\n\n- `animationDidStopForCheckBox:`  \nSent to the delegate every time the check box finishes being animated.\n\n### Customization\n**BEMCheckBox** is exclusively customizable though properties.  \nThe following diagram provides a good overview:  \n\u003cp align=\"center\"\u003e\u003cimg src=\"./.assets/BEMCheckBox properties.jpg\"/\u003e\u003c/p\u003e\n\n\n##### Apparence Properties\n`lineWidth` - CGFloat  \nThe width of the lines of the check mark and box. Defaults to 2.0.  \n\n`hideBox` - BOOL  \nBOOL to control if the box should be hidden or not. Setting this property to `YES` will essentially turn the checkbox into a check mark. Defaults to `NO`.\n\n`boxType` - BEMBoxType   \nThe type of box to use. See `BEMBoxType` for possible values. Defaults to `BEMBoxTypeCircle`. \n\u003cp align=\"center\"\u003e\u003cimg src=\"./.assets/BEMCheckBox box type.jpg\"/\u003e\u003c/p\u003e\n\n`tintColor` - UIColor  \nThe color of the box when the checkbox is Off.\n\n`onCheckColor` - UIColor  \nThe color of the check mark when it is On.\n\n`onFillColor` - UIColor  \nThe color of the inside of the box when it is On.\n\n`onTintColor` - UIColor  \nThe color of the line around the box when it is On.\n\n##### Animations\n`animationDuration` - CGFloat  \nThe duration in seconds of the animations. Defaults to `0.5`.\n\n`onAnimationType` - BEMAnimationType  \nThe type of animation to use when the checkbox gets checked. Defaults to `BEMAnimationTypeStroke`. See `BEMAnimationType` bellow for possible values.\n\n`offAnimationType` - BEMAnimationType  \nThe type of animation to use when the checkbox gets unchecked. Defaults to `BEMAnimationTypeStroke`. See `BEMAnimationType` bellow for possible values.\n\n`BEMAnimationType`  \nThe possible values for `onAnimationType` and `offAnimationType`.  \n- `BEMAnimationTypeStroke`\n\u003cp align=\"left\"\u003e\u003cimg src=\"./.assets/BEMCheckBox-Stroke.gif\"/\u003e\u003c/p\u003e\n\n- `BEMAnimationTypeFill`\n\u003cp align=\"left\"\u003e\u003cimg src=\"./.assets/BEMCheckBox-Fill.gif\"/\u003e\u003c/p\u003e\n\n- `BEMAnimationTypeBounce`\n\u003cp align=\"left\"\u003e\u003cimg src=\"./.assets/BEMCheckBox-Bounce.gif\"/\u003e\u003c/p\u003e\n\n- `BEMAnimationTypeFlat`\n\u003cp align=\"left\"\u003e\u003cimg src=\"./.assets/BEMCheckBox-Flat.gif\"/\u003e\u003c/p\u003e\n\n- `BEMAnimationTypeOneStroke`\n\u003cp align=\"left\"\u003e\u003cimg src=\"./.assets/BEMCheckBox-One-Stroke.gif\"/\u003e\u003c/p\u003e\n\n- `BEMAnimationTypeFade`\n\u003cp align=\"left\"\u003e\u003cimg src=\"./.assets/BEMCheckBox-Fade.gif\"/\u003e\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBoris-Em%2FBEMCheckBox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBoris-Em%2FBEMCheckBox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBoris-Em%2FBEMCheckBox/lists"}