---
title: "label(text:displayed:options:)"
framework: uikit
role: symbol
role_heading: Type Method
path: "uikit/uicellaccessory-swift.struct/label(text:displayed:options:)"
---

# label(text:displayed:options:)

Creates a label system accessory with the specified text, display state, and configuration options.

## Declaration

```swift
static func label(text: String, displayed: UICellAccessory.DisplayedState = .always, options: UICellAccessory.LabelOptions = LabelOptions()) -> UICellAccessory
```

## Parameters

- `text`: The text for the label to display.
- `displayed`: The cell-editing states that the label accessory appears in. This parameter has a default value of doc://com.apple.uikit/documentation/UIKit/UICellAccessory-swift.struct/DisplayedState/always.
- `options`: Configuration options for the label. See doc://com.apple.uikit/documentation/UIKit/UICellAccessory-swift.struct/LabelOptions for possible configuration options.

## Return Value

Return Value A configured label cell accessory. This accessory appears on the trailing edge of the cell.

## Discussion

Discussion Use this cell accessory to display a short string of text, like a small number showing the count for the associated item.

## See Also

### Creating a label accessory

- [UICellAccessory.LabelOptions](uikit/uicellaccessory-swift.struct/labeloptions.md)
