<!--
{
  "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/font",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITextField(py)font"
  },
  "title" : "font"
}
-->

# font

The font of the text.

```
var font: UIFont? { get set }
```

## Discussion

This property applies to the entire text of the text field. It also applies to the placeholder text. The default value of this property is the body style of the system font.

Assigning a new value to this property causes the font to be applied to the entire string in the [`attributedText`](/documentation/UIKit/UITextField/attributedText) and [`attributedPlaceholder`](/documentation/UIKit/UITextField/attributedPlaceholder) properties. If you want to apply the font to only a portion of the text, create a new attributed string with the desired style information and associate it with the text field.

---

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)