Contents

adjustsFontSizeToFitWidth

A Boolean value that determines whether the label reduces the text’s font size to fit the title string into the label’s bounding rectangle.

Declaration

var adjustsFontSizeToFitWidth: Bool { get set }

Discussion

Normally, the label draws the text with the font you specify in the font property. If this property is true, and the text in the text property exceeds the label’s bounding rectangle, the label reduces the font size until the text fits or it has scaled the font down to the minimum font size. The default value for this property is false. If you change it to true, be sure that you also set an appropriate minimum font scale by modifying the minimumScaleFactor property. This autoshrinking behavior is only intended for use with a single-line label.

To enable adjustsFontSizeToFitWidth in Interface Builder, choose Minimum Font Scale from the Autoshrink pop-up menu in the label’s Attributes inspector.

See Also

Related Documentation

Sizing the label’s text