Structure

UIFont.Weight

Standard font weights.

Declaration

struct Weight

Overview

The following constants represent font weights that can be used as values for weight. You can also use these constants to specify the weight parameter in systemFont(ofSize:weight:). Most fonts don't include variants in all these font weights.

Topics

Using System-Defined Font Weights

static let ultraLight: UIFont.Weight

The ultra-light font weight.

static let thin: UIFont.Weight

The thin font weight.

static let light: UIFont.Weight

The light font weight.

static let regular: UIFont.Weight

The regular font weight.

static let medium: UIFont.Weight

The medium font weight.

static let semibold: UIFont.Weight

The semibold font weight.

static let bold: UIFont.Weight

The bold font weight

static let heavy: UIFont.Weight

The heavy font weight.

static let black: UIFont.Weight

The black font weight.

Balancing the Appearance of Symbols and Text

func symbolWeight() -> UIImage.SymbolWeight

Provides the corresponding symbol weight for this font weight.

Relationships

See Also

Creating System Fonts

class func systemFont(ofSize: CGFloat) -> UIFont

Returns the font object used for standard interface items in the specified size.

class func systemFont(ofSize: CGFloat, weight: UIFont.Weight) -> UIFont

Returns the font object used for standard interface items in the specified size and weight.

class func boldSystemFont(ofSize: CGFloat) -> UIFont

Returns the font object used for standard interface items that are rendered in boldface type in the specified size.

class func italicSystemFont(ofSize: CGFloat) -> UIFont

Returns the font object used for standard interface items that are rendered in italic type in the specified size.

class func monospacedSystemFont(ofSize: CGFloat, weight: UIFont.Weight) -> UIFont

Returns the fixed-width font used for standard interface text in the specified size.

class func monospacedDigitSystemFont(ofSize: CGFloat, weight: UIFont.Weight) -> UIFont

Returns the standard system font with all digits in constant width.