Installation • Issues • License
UICheckbox is simple as hell and lightweight class to add 'checkbox' UI component in iOS application. For now it inherits from UIButton but this probably will change in upcoming versions.
UICheckbox requires iOS 8+ and is compatible with Swift 3 projects (for Swift 2.3 support, please check swift-2.3 branch). Please, don't count for Objective-C support ;)
As for CocoaPods, use this to get the latest release:
use_frameworks!
pod 'UICheckbox.Swift'
And import UICheckbox
in the files you'd like to use it.
A custom params available from Interface Builder
- border width
Border width of our UICheckbox - border color
Border color of our UICheckbox - corner radius
Radius if we don't want to have square UICheckbox - padding
Padding of our UICheckbox to increase the 'touch' area (especially for smaller ones)
UICheckbox is a subclass of UIButton (at least for now), so you can add it by adding UIButton class and then just change the class to UICheckbox
Callback to be notified about UICheckbox state changes:
checkbox.onSelectStateChanged = { (checkbox, selected) in
debugPrint("Clicked - \(selected)")
}
To run the example project, clone the repo, and run pod install
from the Example directory first.
Marcin Polak - mpolak87(at).gmail.com
Feel free to fork the project and send us a pull-request! 😎
UICheckbox is available under the MIT license. See the LICENSE file for more info.