ButtonWithTitleAdjustment
open class ButtonWithTitleAdjustment : UIButton
A subclass of UIButton
allowing to easily specify line spacing and kerning.
This class exposes properties allowing to customize the title in Interface Builder.
Internally, this class works by setting setAttributedTitle(_:, for:)
. Do not use
this class if you’re using setAttributedTitle(_:, for:)
anywhere.
-
The line spacing to apply to the button’s title.
Negative values are unsupported. Please refer to the documentation for
NSAttributedString.Key.lineSpacing
for more info.Declaration
Swift
@IBInspectable public var adjustmentLineSpacing: CGFloat { get set }
-
The kern value to apply to the button’s title.
Please refer to the documentation for
NSAttributedString.Key.kernValue
for info about the possible values.Declaration
Swift
@IBInspectable public var adjustmentKerning: CGFloat { get set }
-
Please refer to the documentation for
UIButton.init(frame:)
Declaration
Swift
override public init(frame: CGRect)
-
Please refer to the documentation for
UIButton.init(coder:)
Declaration
Swift
required public init?(coder aDecoder: NSCoder)
-
Please refer to the documentation for
UIButton.setTitleColor(_:, for:)
Declaration
Swift
override open func setTitleColor(_ color: UIColor?, for state: UIControl.State)
-
Please refer to the documentation for
UIButton.setTitle(_:, for:)
Declaration
Swift
override open func setTitle(_ title: String?, for state: UIControl.State)