LLAEasyButton is class for easy use of UIButton.
The class can set normal/selected color.
Also easy use button's label.
github "daisuke-t-jp/LLAEasyButton"
use_frameworks!
target 'target' do
pod 'LLAEasyButton'
end
Open Interface Builder.
Select UIView and put to superview.
(Not UIButton)
Rename UIView’s class name to LLAEasyButton.
If you need to label.
Put UILabel to LLAEasyButton’s subview hierarchy.
You set LLAEasyButton IBOutlet on swift code.
Interface Builder object connet to IBOutlet.
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)]
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)]
button?.subviewLabel()?.text = "button"
button?.subviewLabel()?.textColor = UIColor.blue