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: UIFontTextStyle) -> 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: UIFontTextStyle, compatibleWith: UITraitCollection?)

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] = [:])

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

func withFace(String)

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

func withFamily(String)

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

func withMatrix(CGAffineTransform)

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

func withSize(CGFloat)

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

func withSymbolicTraits(UIFontDescriptorSymbolicTraits)

Returns a new font descriptor that is the same as the receiver but with the specified symbolic traits taking precedence over the existing ones.