Latest 0.1.0
License MIT
Platforms ios 8.0, requires ARC

CI Status


AddButton is a simple button which has two states. One will display an add sign, the other a checkmark.


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


To use AddButton in your own project simply take a UIView object and set its class to AddButton. You can customize various properties directly in Interface Builder like the strokeColor or lineWidth.

In Code

// create an AddButton and add it as a subview
let addButton = AddButton(frame: CGRect(x: 50, y: 50, width: 44, height: 44))

// add target and action
addButton.addTarget(self, action: #selector(addButtonTapped(_:)), forControlEvents: .TouchUpInside)

// change the button state when tapped
@IBAction func addButtonTapped(sender: AddButton) {
  sender.added = !sender.added


AddButton provides various customizations which can be done either in code or in Interface Builder.

/// Stroke color for the add sign.
@IBInspectable public var strokeColor: UIColor = UIColor.blackColor()

/// Line width for the add sign / checkmark.
@IBInspectable public var lineWidth: CGFloat = 2.0

/// When set to `true` the button will display a checkmark. When `false` an add sign.
@IBInspectable public var added: Bool = false

/// The additional spacing between the border of the view and the add sign / checkmark.
@IBInspectable public var margin: CGFloat = 8.0

Additionally there is convenience method to add a border to your button.



  • iOS 8.0
  • Swift 2.0


AddButton is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "AddButton"


Created and maintained by @svenbacia


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

Latest podspec

    "name": "AddButton",
    "version": "0.1.0",
    "summary": "AddButton is a simple button which has two states. One will display an add sign, the other a checkmark.",
    "description": "AddButton is a simple UIButton which can be used in situations where an item can be added to a collection for example. The button has two states. One displays an add sign the other a checkmark.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Sven Bacia": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.0"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "AddButton": [

Pin It on Pinterest

Share This