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

# typingAttributes

The attributes to apply to new text that the user enters.

## Declaration

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

## Discussion

Discussion This dictionary contains the attribute keys (and corresponding values) to apply to newly typed text. When the text field’s selection changes, the contents of the dictionary are cleared automatically. If the text field is not in editing mode, this property contains the value nil. Similarly, you cannot assign a value to this property unless the text field is currently in editing mode.

## See Also

### Related Documentation

- [isEditing](uikit/uitextfield/isediting.md)

### Configuring the text attributes

- [text](uikit/uitextfield/text.md)
- [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)
- [UITextField.BorderStyle](uikit/uitextfield/borderstyle-swift.enum.md)
