<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITextView/attributedText",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITextView(py)attributedText"
  },
  "title" : "attributedText"
}
-->

# attributedText

The styled text that the text view displays.

```
@NSCopying var attributedText: NSAttributedString! { get set }
```

## Discussion

Assigning a new value to this property also replaces the value of the [`text`](/documentation/UIKit/UITextView/text) property with the same string data, albeit without any formatting information. In addition, the [`font`](/documentation/UIKit/UITextView/font), [`textColor`](/documentation/UIKit/UITextView/textColor), and [`textAlignment`](/documentation/UIKit/UITextView/textAlignment) properties are updated to reflect the typing attributes of the text view.

---

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)