YMAButtonAppearance

Objective-C

@interface YMAButtonAppearance : NSObject <NSCopying, NSMutableCopying>

Swift

class YMAButtonAppearance : NSObject, NSCopying, NSMutableCopying

A class with fixed settings for the standard button appearance. If you want to edit the standard appearance settings, use the YMAMutableButtonAppearance class.

  1. Properties
  2. textAppearance
  3. highlightedTextColor
  4. normalColor
  5. highlightedColor
  6. borderColor
  7. borderWidth
  8. Methods
  9. +appearanceWithTextAppearance:normalColor:highlightedColor:borderColor:borderWidth:
  10. +appearanceWithTextAppearance:highlightedTextColor:normalColor:highlightedColor:borderColor:borderWidth:

Properties

textAppearance

Settings for the button label (YMALabelAppearance).

Declaration

Objective-C

@property (nonatomic, copy, readonly) YMALabelAppearance *_Nonnull textAppearance;

Swift

@NSCopying var textAppearance: YMALabelAppearance { get }

highlightedTextColor

Label color when the button is clicked.

Declaration

Objective-C

@property (nonatomic, strong, readonly) UIColor *_Nonnull highlightedTextColor;

normalColor

The color of the button background in its normal state.

Declaration

Objective-C

@property (nonatomic, strong, readonly) UIColor *_Nonnull normalColor;

highlightedColor

The color of the button background when clicked.

Declaration

Objective-C

@property (nonatomic, strong, readonly) UIColor *_Nonnull highlightedColor;

borderColor

The color of the button border.

Declaration

Objective-C

@property (nonatomic, strong, readonly) UIColor *_Nonnull borderColor;

borderWidth

The width of the button border.

Declaration

Objective-C

@property (nonatomic, readonly) CGFloat borderWidth;

Swift

var borderWidth: CGFloat { get }

Methods

+appearanceWithTextAppearance:normalColor:highlightedColor:borderColor:borderWidth:

Creates an object of the YMAButtonAppearance class, that is, a button with the specified appearance (label font, label color, border color, and other settings).

Declaration

Objective-C

+ (nonnull instancetype)
    appearanceWithTextAppearance:(nonnull YMALabelAppearance *)textAppearance
                     normalColor:(nonnull UIColor *)normalColor
                highlightedColor:(nonnull UIColor *)highlightedColor
                     borderColor:(nonnull UIColor *)borderColor
                     borderWidth:(CGFloat)borderWidth;

Swift

convenience init(textAppearance: YMALabelAppearance, normalColor: Any!, highlightedColor: Any!, borderColor: Any!, borderWidth: CGFloat)

Parameters

textAppearance

Settings for the button label (YMALabelAppearance).

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 width of the button border.

textAppearance

Settings for the button label (YMALabelAppearance).

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 width of the button border.

Return Value

Configured button appearance.

+appearanceWithTextAppearance:highlightedTextColor:normalColor:highlightedColor:borderColor:borderWidth:

Creates an object of the YMAButtonAppearance class, that is, a button with the specified appearance (label font, label color, border color, and other settings).

Declaration

Objective-C

+ (nonnull instancetype)
    appearanceWithTextAppearance:(nonnull YMALabelAppearance *)textAppearance
            highlightedTextColor:(nonnull UIColor *)highlightedTextColor
                     normalColor:(nonnull UIColor *)normalColor
                highlightedColor:(nonnull UIColor *)highlightedColor
                     borderColor:(nonnull UIColor *)borderColor
                     borderWidth:(CGFloat)borderWidth;

Swift

convenience init(textAppearance: YMALabelAppearance, highlightedTextColor: Any!, normalColor: Any!, highlightedColor: Any!, borderColor: Any!, borderWidth: CGFloat)

Parameters

textAppearance

Settings for the button label (YMALabelAppearance).

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 width of the button border.

textAppearance

Settings for the button label (YMALabelAppearance).

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 width of the button border.

Return Value

Configured button appearance.