<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITextField/adjustsFontSizeToFitWidth",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITextField(py)adjustsFontSizeToFitWidth"
  },
  "title" : "adjustsFontSizeToFitWidth"
}
-->

# adjustsFontSizeToFitWidth

A Boolean value that indicates whether to reduce the font size to fit the text string into the text field’s bounding rectangle.

```
var adjustsFontSizeToFitWidth: Bool { get set }
```

## Discussion

Normally, the text field’s content is drawn with the font you specify in the [`font`](/documentation/UIKit/UITextField/font) property. If this property is set to <doc://com.apple.documentation/documentation/Swift/true>, however, and the contents in the [`text`](/documentation/UIKit/UITextField/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 <doc://com.apple.documentation/documentation/Swift/false>. If you change it to <doc://com.apple.documentation/documentation/Swift/true>, you should also set an appropriate minimum font size by modifying the [`minimumFontSize`](/documentation/UIKit/UITextField/minimumFontSize) property.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)