---
title: text
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uilabel/text
---

# text

The text that the label displays.

## Declaration

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

## Discussion

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

## See Also

### Accessing the text attributes

- [attributedText](uikit/uilabel/attributedtext.md)
- [font](uikit/uilabel/font.md)
- [textColor](uikit/uilabel/textcolor.md)
- [textAlignment](uikit/uilabel/textalignment.md)
- [lineBreakMode](uikit/uilabel/linebreakmode.md)
- [lineBreakStrategy](uikit/uilabel/linebreakstrategy.md)
- [isEnabled](uikit/uilabel/isenabled.md)
- [enablesMarqueeWhenAncestorFocused](uikit/uilabel/enablesmarqueewhenancestorfocused.md)
- [showsExpansionTextWhenTruncated](uikit/uilabel/showsexpansiontextwhentruncated.md)
