https://github.com/bradhowes/checkbox
Embarrassingly simple UIControl with binary state that appears as a garden-variety checkbox.
https://github.com/bradhowes/checkbox
ios swift-package-manager swift5 ui-components uicontrol
Last synced: 3 months ago
JSON representation
Embarrassingly simple UIControl with binary state that appears as a garden-variety checkbox.
- Host: GitHub
- URL: https://github.com/bradhowes/checkbox
- Owner: bradhowes
- License: mit
- Created: 2020-12-01T23:08:54.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-02T01:12:25.000Z (over 4 years ago)
- Last Synced: 2024-05-02T02:56:49.556Z (about 1 year ago)
- Topics: ios, swift-package-manager, swift5, ui-components, uicontrol
- Language: Swift
- Homepage:
- Size: 46.9 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/bradhowes/Checkbox)
[](https://apple.com)
[](https://swift.org)
[](https://swift.org/package-manager/)
[](https://opensource.org/licenses/MIT)# Checkbox
Extremely simple checkbox control for iOS using CoreAnimation layers.

Included is a playground for playing with a collection of checkboxen.
## Configuration
* `isChecked` -- the current value of the control.
* `borderLineWidth` -- the line width of the border that is drawn around the view's frame
* `borderShape` -- the border to render. Currently supports two shapes: square and circle
* `uncheckedBorderColor` -- the color of the border when the control is unchecked
* `checkedBorderColor` -- the color of the border when the control is checked
* `checkShape` -- the checked indicator to render. Support 4 shapes: square, circle, check, and cross
* `checkLineWidth` -- the line width of the check and cross shapes
* `checkInserts` -- the amount to reduce the border frame before being used for the checked shape frameNOTE: the color of the checked shape comes from the UIView `tintColor` value.