Contents

preferredFontDescriptor(withTextStyle:compatibleWith:)

Returns a font descriptor that contains the text style and the content size category that the provided trait collection specifies.

Declaration

class func preferredFontDescriptor(withTextStyle style: UIFont.TextStyle, compatibleWith traitCollection: UITraitCollection?) -> UIFontDescriptor

Parameters

  • style:

    The text style for which to return a font descriptor.

  • traitCollection:

    The trait collection containing the content size category information.

Return Value

The new font descriptor.

See Also

Creating a font descriptor