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

# defaultTextAttributes

The default attributes to apply to the text.

## Declaration

```swift
var defaultTextAttributes: [NSAttributedString.Key : Any] { get set }
```

## Discussion

Discussion By default, this property returns a dictionary of text attributes with default values. Setting this property applies the specified attributes to the entire text of the text field. Unset attributes maintain their default values. Getting this property returns the previously set attributes, which may have been modified by setting properties such as font and textColor.

## See Also

### Configuring the text attributes

- [text](uikit/uitextfield/text.md)
- [attributedText](uikit/uitextfield/attributedtext.md)
- [placeholder](uikit/uitextfield/placeholder.md)
- [attributedPlaceholder](uikit/uitextfield/attributedplaceholder.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)
