The attributes to apply to new text being entered by the user.
SDKs
- iOS 6.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- UIKit
Declaration
var typingAttributes: [NSAttributed String.Key : Any]? { get set }
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.