UIButton Extensions

Omar Albeik edited this page Dec 9, 2016 · 3 revisions

UIButton extensions

Properties:

Name Description
imageForDisabled Image of disabled state for button; also inspectable from Storyboard.
imageForHighlighted Image of highlighted state for button; also inspectable from Storyboard.
imageForNormal Image of normal state for button; also inspectable from Storyboard.
imageForSelected Image of selected state for button; also inspectable from Storyboard.
titleColorForDisabled Title color of disabled state for button; also inspectable from Storyboard.
titleColorForHighlighted Title color of highlighted state for button; also inspectable from Storyboard.
titleColorForNormal Title color of normal state for button; also inspectable from Storyboard.
titleColorForSelected Title color of selected state for button; also inspectable from Storyboard.
titleForDisabled Title of disabled state for button; also inspectable from Storyboard.
titleForHighlighted Title of highlighted state for button; also inspectable from Storyboard.
titleForNormal Title of normal state for button; also inspectable from Storyboard.
titleForSelected Title of selected state for button; also inspectable from Storyboard.

Methods:

Name Return Description
setImageForAllStates(_ image: UIImage) -- Set image for all states.
setTitleColorForAllStates(_ color: UIColor) -- Set title color for all states.
setTitleForAllStates(_ title: String) -- Set title for all states.