Latest 1.0.7
Homepage https://github.com/daisuke-t-jp/LLAEasyButton
License MIT
Platforms ios 10.0, requires ARC
Authors


Platform
Language Swift%205.0
Carthage compatible
Cocoapods
Build Status


What is this?

LLAEasyButton is class for easy use of UIButton.
The class can set normal/selected color.
Also easy use button’s label.

Install

Carthage

github "daisuke-t-jp/LLAEasyButton"

CocoaPods

use_frameworks!

target 'target' do
pod 'LLAEasyButton'
end

Works at Interface Builder

1. Set view





Open Interface Builder.
Select UIView and put to superview.
(Not UIButton)

2. Change class



Rename UIView’s class name to LLAEasyButton.

3. Add label (If you need)





If you need to label.
Put UILabel to LLAEasyButton’s subview hierarchy.

4. Set IBOutlet



You set LLAEasyButton IBOutlet on swift code.

5. Connect IBOutlet







Interface Builder object connet to IBOutlet.

Usage

1. Set normal/selected color on enable state

button?.colorMapEnable = [.normal: UIColor.init(red: 239/255, green: 154/255, blue: 154/255, alpha: 1.0),
  .selected: UIColor.init(red: 244/255, green: 67/255, blue: 54/255, alpha: 1.0)]

2. Set normal/selected color on disable state

button?.colorMapDisable = [.normal: UIColor.init(red: 239/255, green: 154/255, blue: 154/255, alpha: 1.0),
  .selected: UIColor.init(red: 244/255, green: 67/255, blue: 54/255, alpha: 1.0)]

3. Set button’s label text

button?.subviewLabel()?.text = "button"
button?.subviewLabel()?.textColor = UIColor.blue

Latest podspec

{
    "name": "LLAEasyButton",
    "version": "1.0.7",
    "summary": "LLAEasyButton is class for easy use of UIButton.",
    "description": ""LLAEasyButton" is class for easy use of UIButton.nThe class can set normal/selected color.nAlso easy use button's label.",
    "homepage": "https://github.com/daisuke-t-jp/LLAEasyButton",
    "screenshots": "https://raw.githubusercontent.com/daisuke-t-jp/LLAEasyButton/master/doc/header.png",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "daisuke-t-jp": "[email protected]"
    },
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/daisuke-t-jp/LLAEasyButton.git",
        "tag": "1.0.7"
    },
    "source_files": "LLAEasyButton/LLAEasyButton/*.{swift}",
    "swift_version": "5.0",
    "requires_arc": true
}

Pin It on Pinterest

Share This