UIButton
public extension UIButton
-
Sets the button’s title underlined with style and for state specified.
Declaration
Swift
func setUnderlined(title: String, style: NSUnderlineStyle = NSUnderlineStyle.single, color: UIColor? = .none, forState state: UIControl.State = .normal)Parameters
titleTitle for the button.
styleNSUnderlineStyle with which the title is underlined. By default, StyleSingle.
colorUIColor for the underline, or None if the color should be the same as the foreground’s. By default, None.
forStateUIControlState for which to set the title. By default, Normal.
-
Sets the button’s title and image with the specified spacing and arrangement.
Seealso
CGAffineTransform(scaleX:y:)Declaration
Swift
func setTitle(title: String, image: UIImage, spacing: CGFloat = 0, imageOnRight: Bool = false)Parameters
titleTitle for the button.
imageImage for the button.
spacingSpacing between the title and the button.
imageOnRightBoolean indicating whether the the image should be to the right of the text or to the left. By default, false (to the left).
UIButton Extension Reference