Instance Property

baselineAdjustment

An option that controls whether the text's baseline should remain fixed when text needs to shrink to fit in the label.

Declaration

var baselineAdjustment: UIBaselineAdjustment { get set }

Discussion

If adjustsFontSizeToFitWidth is true, this property controls the behavior of the text baselines in situations where the text needs the font size adjusted in order to fit. The default value of this property is UIBaselineAdjustment.alignBaselines. This property is effective only when the numberOfLines is 1.

See Also

Sizing the Label’s Text

var adjustsFontSizeToFitWidth: Bool

A Boolean value indicating whether the label should reduce the text’s font size in order to fit the title string into the label’s bounding rectangle.

var allowsDefaultTighteningForTruncation: Bool

A Boolean value indicating whether the label tightens text before truncating.

var minimumScaleFactor: CGFloat

The minimum scale factor supported for the label’s text.

var numberOfLines: Int

The maximum number of lines to use for rendering text.