---
title: text
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uitextfield/text
---

# text

The text that the text field displays.

## Declaration

```swift
var text: String? { get set }
```

## Discussion

Discussion Assigning a new value to this property also replaces the value of the attributedText property with the same text, albeit without any inherent style attributes. Instead the text view styles the new string using the font, textColor, and other style-related properties of the class. This value is nil by default.

## See Also

### Configuring the text attributes

- [attributedText](uikit/uitextfield/attributedtext.md)
- [placeholder](uikit/uitextfield/placeholder.md)
- [attributedPlaceholder](uikit/uitextfield/attributedplaceholder.md)
- [defaultTextAttributes](uikit/uitextfield/defaulttextattributes.md)
- [font](uikit/uitextfield/font.md)
- [textColor](uikit/uitextfield/textcolor.md)
- [textAlignment](uikit/uitextfield/textalignment.md)
- [typingAttributes](uikit/uitextfield/typingattributes.md)
- [UITextField.BorderStyle](uikit/uitextfield/borderstyle-swift.enum.md)
