Skip to content

Appearance

Yehor Miroshnychenko edited this page Dec 15, 2018 · 5 revisions

StatusAlert's appearance presented as StatusAlert.Appearance. It has common property, which contains default appearance settings for all newly created alerts.

All appearance properties

Title font

public var titleFont: UIFont

Used for StatusAlert's title label.

Message font

public var messageFont: UIFont

Used for StatusAlert's message label.

Tint color

public var tintColor: UIColor

Used as textColor for title and message labels and as image tintColor (if image is in template mode).

Background color

public var backgroundColor: UIColor

Used as alert's background color.

NOTE

Used only if "Reduce transparency" mode is on (See Accessibility for more details).

Blur style

public var blurStyle: UIBlurEffect.Style

Used if blur is available.

Common appearance

To edit default appearance for all alerts in the application you should edit StatusAlert.Appearance.common.

EXAMPLE

To make titleFont to be system font of size 17 and weight Regular do the following:

StatusAlert.Appearance.titleFont = UIFont.systemFont(ofSize: 17, weight: UIFontWeightRegular)

After that all alert will have this appearance unless you change it for specific instance.

Single alert appearance

To change appearance of the single alert edit alert's appearance property.

EXAMPLE

To make titleFont to be system font of size 17 and weight Regular do the following:

alert.appearance.titleFont = UIFont.systemFont(ofSize: 17, weight: UIFontWeightRegular)

After that this alert will have different appearance, but the other alert's appearance will not be affected.