SimpleCheckbox aims to accomplish what other ios checkbox controls haven’t. To be simple. There’s no animations, no IBDesignable to slow down interface builder, and no performance heavy draw methods.
🎉 Features
📒 Documentation
⚖️ Carefully tuned default values.
✅ Requirements
Xcode 11
iOS 10+
Swift 5.1
👨💻 Installation
Manual
Just drag Checkbox.swift into your project to start using it.
Carthage
Add github "BeauNouvelle/SimpleCheckbox" to your Cartfile.
You can learn more about Carthage and get help setting it up here.
Cocoapods
Podspec is present, however with SPM out for quite a while now, Cocoapods is no longer officially supported.
Latest supported version of SimpleCheckbox is 2.2.2
Swift Package Manager
Add https://github.com/BeauNouvelle/SimpleCheckbox.git to your package file.
👩🍳 Usage
You can create a new Checkbox either programatically:
checkbox.valueChanged = { (isChecked) in
print("checkbox is checked: \(isChecked)")
}
Touch Area
Checkboxs can sometimes appear smaller than their UIButton and UISwitch counterparts which can make them difficult to activate.
SimpleCheckbox has a way for you to tune the touch raduis to extend beyond its frame. Setting increasedTouchRadius will increase the touch radius by that amount.
SimpleCheckbox aims to accomplish what other ios checkbox controls haven’t. To be simple. There’s no animations, no IBDesignable to slow down interface builder, and no performance heavy draw methods.
🎉 Features
📒 Documentation
⚖️ Carefully tuned default values.
✅ Requirements
👨💻 Installation
Manual
Just drag Checkbox.swift into your project to start using it.
Carthage
github "BeauNouvelle/SimpleCheckbox"
to yourCartfile
.You can learn more about Carthage and get help setting it up here.
Cocoapods
Podspec is present, however with SPM out for quite a while now, Cocoapods is no longer officially supported. Latest supported version of SimpleCheckbox is 2.2.2
Swift Package Manager
https://github.com/BeauNouvelle/SimpleCheckbox.git
to your package file.👩🍳 Usage
You can create a new Checkbox either programatically:
Or using interface builder by dragging a
UIView
into your view controller and assigning its class toCheckbox
.After hooking up an outlet you can begin customization.
👩🎨 Customization
Border
Border Color
Border Style
Checkmark
Checkmark Color
Checkmark Style
Emoji
NOTE: Setting the emoji value will cause simple checkbox to ignore the checkmarkStyle. Any string will work, but only 1-3 characters may be displayed.
Haptic Feedback
Events
There are two methods for detecting when a tap event has occured and the
isChecked
property has changed.Add Target
Closure
Touch Area
Checkboxs can sometimes appear smaller than their UIButton and UISwitch counterparts which can make them difficult to activate.
SimpleCheckbox has a way for you to tune the touch raduis to extend beyond its frame. Setting increasedTouchRadius will increase the touch radius by that amount.
🎩 Fancy Alternatives
Objective C — BEMCheckbox
Swift — M13Checkbox