Contents

withDesign(_:)

Returns a new font descriptor that’s the same as the existing descriptor, but with the specified design.

Declaration

func withDesign(_ design: UIFontDescriptor.SystemDesign) -> UIFontDescriptor?

Parameters

  • design:

    The new system font design.

Return Value

The new font descriptor, if the original font descriptor is from a system UI font; otherwise, nil.

Discussion

This method changes the design of an existing font descriptor that describes a system UI font — for example, a font descriptor created by methods such as systemFont(ofSize:), preferredFont(forTextStyle:), or preferredFontDescriptor(withTextStyle:). If the original font descriptor doesn’t describe a system font, this method returns nil.

See Also

Creating a font descriptor