Type Method

preferredFontDescriptor(withTextStyle:)

Returns a font descriptor containing the given text style and the user's selected content size category.

Declaration

class func preferredFontDescriptor(withTextStyle style: UIFont.TextStyle) -> UIFontDescriptor

Parameters

style

The text style for which to return a font descriptor. See Text Styles for valid values.

Return Value

The new font descriptor.

See Also

Creating a Font Descriptor

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

Returns a font descriptor containing the text style and the content size category specified by the provided trait collection.

init(name: String, matrix: CGAffineTransform)

Returns a font descriptor with the UIFontDescriptorNameAttribute and UIFontDescriptorMatrixAttribute dictionary attributes set to the given values.

init(name: String, size: CGFloat)

Returns a font descriptor with the UIFontDescriptorNameAttribute and UIFontDescriptorSizeAttribute dictionary attributes set to the given values.

func addingAttributes([UIFontDescriptor.AttributeName : Any]) -> UIFontDescriptor

Returns a new font descriptor that is the same as the existing descriptor, but with the specified attributes taking precedence over the existing ones.

func withDesign(UIFontDescriptor.SystemDesign) -> UIFontDescriptor?

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

func withFamily(String) -> UIFontDescriptor

Returns a new font descriptor whose attributes are the same as the existing font descriptor, but from the specified family.

func withFace(String) -> UIFontDescriptor

Returns a new font descriptor that is the same as the existing font descriptor, but with the specified face.

func withMatrix(CGAffineTransform) -> UIFontDescriptor

Returns a new font descriptor that is the same as the existing font descriptor, but with the specified matrix.

func withSize(CGFloat) -> UIFontDescriptor

Returns a new font descriptor that is the same as the existing font descriptor, but with the specified point size.

func withSymbolicTraits(UIFontDescriptor.SymbolicTraits) -> UIFontDescriptor?

Returns a new font descriptor that is the same as the existing font descriptor, but with the specified symbolic traits.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software