Latest 1.0.1
Homepage https://github.com/kha26/SwiftFillButton
License MIT
Platforms ios 10.0
Authors

CI Status
Version
License
Platform

Simple button in Swift that fills up on a click.

SwiftFillButton
SwiftFillButton
SwiftFillButton

Installation

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

pod 'SwiftFillButton'

Usage

First import the module with:

import SwiftFillButton

Then you can configure a button programatically like this:

let button3 = FillButton()

// The highlight color is the color that the backround will be on click
button3.highlightColor = UIColor.purple
button3.unhighlightColor = UIColor.cyan

// To set the text bold on click
button3.isHighlightBold = true

// To add zoom on click
button3.doesZoom = true

// If the zoomScale is greater than 1 the button will increase in size on click
// if it's less than 1 the button will be smaller on click
button3.zoomScale = 1.05

Interface Builder (Storyboard/Xib)

Add a UIButton as usual, then:

  • Modify the underlying class to SwiftFillButton/FillButton and that the module to SwiftFillButton
  • Make sure the UIButtonType is set to .custom

SwiftFillButton
SwiftFillButton

Example

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

Author

kha26, [email protected]

License

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

Latest podspec

{
    "name": "SwiftFillButton",
    "version": "1.0.1",
    "summary": "SwiftFillButton is a subclass of UIButton that fills up when clicked.",
    "description": "SwiftFillButton is a subclass of UIButton. When the user clicks on the button, the background changes to the desired color. The button also zooms in and/or makes the text bold on a click event.",
    "homepage": "https://github.com/kha26/SwiftFillButton",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "kha26": "[email protected]"
    },
    "source": {
        "git": "https://github.com/kha26/SwiftFillButton.git",
        "tag": "1.0.1"
    },
    "platforms": {
        "ios": "10.0"
    },
    "swift_version": "3.2",
    "source_files": "SwiftFillButton/Classes/**/*"
}

Pin It on Pinterest

Share This