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

# text

The text that the label displays.

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

## Discussion

This property is `nil` by default. Assigning a new value to this property also replaces the value of the [`attributedText`](/documentation/UIKit/UILabel/attributedText) property with the same text, although without any inherent style attributes. Instead the label styles the new string using [`shadowColor`](/documentation/UIKit/UILabel/shadowColor), [`textAlignment`](/documentation/UIKit/UILabel/textAlignment), and other style-related properties of the class.

---

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)