Instance Property

adjustsFontSizeToFitWidth

A Boolean value indicating whether the font size should be reduced in order to fit the text string into the text field’s bounding rectangle.

Declaration

var adjustsFontSizeToFitWidth: Bool { get set }

Discussion

Normally, the text field’s content is drawn with the font you specify in the font property. If this property is set to true, however, and the contents in the text property exceed the text field’s bounding rectangle, the receiver starts reducing the font size until the string fits or the minimum font size is reached. The text is shrunk along the baseline.

The default value for this property is false. If you change it to true, you should also set an appropriate minimum font size by modifying the minimumFontSize property.

See Also

Sizing the Text Field’s Text

var minimumFontSize: CGFloat

The size of the smallest permissible font with which to draw the text field’s text.