Latest 3.1.1
Homepage https://github.com/chrisamanse/CheckboxButton
License MIT
Platforms ios 8.0, requires ARC
Authors

Build Status
Carthage compatible

A checkbox button UI component for iOS built with Swift.

CheckboxButton image

CheckboxButton

  • A subclass of UIControl. The container will fit the frame of the control while maintaining its aspect ratio.

Installation

This project can be installed in different ways:

  • Manual
    1. Download the project
    2. Simply copy CheckboxButton.swift to your project
  • Framework
    1. Download the project
    2. Build the CheckboxButton framework
    3. Embed the framework into your project
  • Carthage
    1. Add github "chrisamanse/CheckboxButton" in your Cartfile

Usage

CheckboxButton can be used in two different ways:

  • Interface Builder
    • Simply change the class of the UIButton to CheckboxButton.
  • Code
    • Use the initializer: init(frame: CGRect)

You can run the example app located in the same project to see how it’s used.

Toggle

CheckboxButton will be toggled when a .TouchedUpInside event occurred. You can observe changes in state using the UIControlEvents.ValueChanged event.

You can check if the checkbox is toggled by reading the on property. You can also set this property to programmatically set the state of the checkbox.


if checkbox.on {
  print("Checkbox is checked")
}

// Toggle
checkbox.on = false // Set to false to uncheck

License

Copyright (c) 2016 Joe Christopher Paul Amanse

This software is distributed under the MIT License.

Latest podspec

{
    "name": "CheckboxButton",
    "version": "3.1.1",
    "summary": "A checkbox button UI component for iOS built with Swift",
    "description": "A checkbox button UI component for iOS built with Swift. `CheckboxButton` is simply a subclass of `UIControl`.",
    "homepage": "https://github.com/chrisamanse/CheckboxButton",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Chris Amanse": "[email protected]"
    },
    "social_media_url": "http://twitter.com/ChrisAmanse",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/chrisamanse/CheckboxButton.git",
        "tag": "3.1.1"
    },
    "source_files": [
        "CheckboxButton",
        "CheckboxButton/**/*.{h,swift}"
    ],
    "requires_arc": true,
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "4.0"
    },
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This