Latest 1.0.0
Homepage https://github.com/polok/UICheckbox.Swift
License MIT
Platforms ios 8.0
Authors

Storage

Platform: iOS 8+Language: Swift 2
CocoaPods compatible
License: MIT

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.

Demo

Demo UICheckbox

Compatibility

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 ;)

Installation

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.

Usage

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)")
}

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Author

Marcin Polak – mpolak87(at).gmail.com

Contribution

Feel free to fork the project and send us a pull-request! :sunglasses:

License

UICheckbox is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "UICheckbox.Swift",
    "version": "1.0.0",
    "summary": "UICheckbox.Swift is simple as hell and lightweight class to add 'checkbox' UI component in iOS application.",
    "homepage": "https://github.com/polok/UICheckbox.Swift",
    "screenshots": "https://raw.githubusercontent.com/polok/UICheckbox.Swift/master/Resources/uicheckbox_example.png",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "marcin.polak": "[email protected]"
    },
    "source": {
        "git": "https://github.com/polok/UICheckbox.Swift.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "UICheckbox/Classes/**/*",
    "resource_bundles": {
        "UICheckbox": [
            "UICheckbox/Assets/*.png"
        ]
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This