ButtonAppearance

@objc(YMAButtonAppearance)
@objcMembers
public class ButtonAppearance : NSObject, NSCopying, NSMutableCopying

A class with fixed settings for the standard button appearance.

Remark

If you want to edit the standard appearance settings, use the MutableNativeTemplateAppearance class.
  • Settings for the button label.

    Declaration

    Swift

    public var textAppearance: LabelAppearance { get }
  • Label color when the button is clicked.

    Declaration

    Swift

    public var highlightedTextColor: UIColor { get }
  • The color of the button background in its normal state.

    Declaration

    Swift

    public var normalColor: UIColor { get }
  • The color of the button background when clicked.

    Declaration

    Swift

    public var highlightedColor: UIColor { get }
  • The color of the button border.

    Declaration

    Swift

    public var borderColor: UIColor { get }
  • The thickness of the button border.

    Declaration

    Swift

    public var borderWidth: CGFloat { get }
  • Corresponding mutable representation of current button appearance.

    Declaration

    Swift

    public var mutableAppearance: MutableButtonAppearance { get }
  • Undocumented

    Declaration

    Swift

    override public convenience init()
  • Creates an object of the ButtonAppearance class, i.e., a button with the specified appearance (label font, label color, border color, and other settings).

    Declaration

    Swift

    public required convenience init(
        textAppearance: LabelAppearance,
        normalColor: UIColor,
        highlightedColor: UIColor,
        borderColor: UIColor,
        borderWidth: CGFloat
    )

    Parameters

    textAppearance

    Settings for the button label.

    normalColor

    The color of the button background in its normal state.

    highlightedColor

    The color of the button background when clicked.

    borderColor

    The color of the button border.

    borderWidth

    The thickness of the button border.

    Return Value

    Configured button appearance.

  • Creates an object of the ButtonAppearance class, i.e., a button with the specified appearance (label font, label color, border color, and other settings).

    Declaration

    Swift

    public required convenience init(
        textAppearance: LabelAppearance,
        highlightedTextColor: UIColor,
        normalColor: UIColor,
        highlightedColor: UIColor,
        borderColor: UIColor,
        borderWidth: CGFloat
    )

    Parameters

    textAppearance

    Settings for the button label.

    highlightedTextColor

    Label color when the button is clicked.

    normalColor

    The color of the button background in its normal state.

    highlightedColor

    The color of the button background when clicked.

    borderColor

    The color of the button border.

    borderWidth

    The thickness of the button border.

    Return Value

    Configured button appearance.

  • Creates an object of the ButtonAppearance class, i.e., a button with the specified appearance (label font, label color, border color, and other settings).

    Declaration

    Swift

    public static func appearanceWithTextAppearance(
        _ textAppearance: LabelAppearance,
        normalColor: UIColor,
        highlightedColor: UIColor,
        borderColor: UIColor,
        borderWidth: CGFloat
    ) -> Self

    Parameters

    textAppearance

    Settings for the button label.

    normalColor

    The color of the button background in its normal state.

    highlightedColor

    The color of the button background when clicked.

    borderColor

    The color of the button border.

    borderWidth

    The thickness of the button border.

    Return Value

    Configured button appearance.

  • Undocumented

    Declaration

    Swift

    public static func appearanceWithTextAppearance(
        _ textAppearance: LabelAppearance,
        highlightedTextColor: UIColor,
        normalColor: UIColor,
        highlightedColor: UIColor,
        borderColor: UIColor,
        borderWidth: CGFloat
    ) -> Self

NSCopying

  • Undocumented

    Declaration

    Swift

    public func copy(with zone: NSZone? = nil) -> Any

NSMutableCopying

  • Undocumented

    Declaration

    Swift

    public func mutableCopy(with zone: NSZone? = nil) -> Any