monospacedSystemFont(ofSize:weight:)
Returns the fixed-width font for standard interface text in the specified size.
Declaration
class func monospacedSystemFont(ofSize fontSize: CGFloat, weight: UIFont.Weight) -> UIFontParameters
- fontSize:
The size (in points) for the font. This value must be greater than
0.0. - weight:
The weight of the font, specified as a font weight constant. For a list of possible values, see Weight. Avoid passing an arbitrary floating-point number for
weight, because a font might not include a variant for every weight.
Return Value
A font object of the specified size.
Discussion
This method provides the same font as the monospaced system font descriptor. For design guidance, see Typography in the Human Interface Guidelines.