<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "tvOS: 14.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICellAccessory-swift.struct/label(text:displayed:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:5UIKit15UICellAccessoryV5label4text9displayed7optionsACSS_AC14DisplayedStateOAC12LabelOptionsVtFZ"
  },
  "title" : "label(text:displayed:options:)"
}
-->

# label(text:displayed:options:)

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

```
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 [`UICellAccessory.DisplayedState.always`](/documentation/UIKit/UICellAccessory-swift.struct/DisplayedState/always).

`options`

Configuration options for the label. See [`UICellAccessory.LabelOptions`](/documentation/UIKit/UICellAccessory-swift.struct/LabelOptions) for possible configuration options.

## Return Value

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

## Discussion

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

---

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)