<!--
{
  "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/UITableViewCell",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITableViewCell"
  },
  "title" : "UITableViewCell"
}
-->

# UITableViewCell

The visual representation of a single row in a table view.

```
@MainActor class UITableViewCell
```

## Overview

A [`UITableViewCell`](/documentation/UIKit/UITableViewCell) object is a specialized type of view that manages the content of a single table row. You use cells primarily to organize and present your app’s custom content, but [`UITableViewCell`](/documentation/UIKit/UITableViewCell) provides some specific customizations to support table-related behaviors, including:

- Applying a selection or highlight color to the cell
- Adding standard accessory views, such as a detail or disclosure control
- Putting the cell into an editable state
- Indenting the cell’s content to create a visual hierarchy in your table

Your app’s content occupies most of the cell’s bounds, but the cell may adjust that space to make room for other content. Cells display accessory views on the trailing edge of their content area. When you put your table into edit mode, the cell adds a delete control to the leading edge of its content area, and optionally swaps out an accessory view for a reorder control.

![Illustration showing the area of a cell by itself and with an accessory view and edit control. The content area of a cell shrinks as needed to accommodate the accessory view or edit controls.](images/com.apple.uikit/media-3113230@2x.png)

Every table view must have at least one type of cell for displaying content, and tables may have multiple cell types to display different types of content. Your table’s data source object handles the creation and configuration of cells immediately before they appear onscreen. For information about how to create your table’s cells, see [Filling a table with data](/documentation/UIKit/filling-a-table-with-data).

### Configure your cell’s content

Configure the content and layout of your cells in your storyboard file. Tables have one cell type by default, but you can add more by changing the value in the table’s Prototype Cells attribute. In addition to configuring the cell’s content, make sure you configure the following attributes:

- Identifier. Use this identifier (also known as a reuse identifier) to create the cell.
- Style. Choose one of the standard types or define a custom cell.
- Class. Specify a [`UITableViewCell`](/documentation/UIKit/UITableViewCell) subclass with your custom behavior.

To configure the content and appearance of your cell, you can set its [`contentConfiguration`](/documentation/UIKit/UITableViewCell/contentConfiguration-9ktox) and [`backgroundConfiguration`](/documentation/UIKit/UITableViewCell/backgroundConfiguration-24e8e).

## Topics

### Creating a table view cell

[`-  initWithStyle:reuseIdentifier:`](/documentation/UIKit/UITableViewCell/init(style:reuseIdentifier:))

Initializes a table cell with a style and a reuse identifier and returns it to the caller.

[`CellStyle`](/documentation/UIKit/UITableViewCell/CellStyle)

An enumeration for the various styles of cells.

[`-  initWithCoder:`](/documentation/UIKit/UITableViewCell/init(coder:))

Creates a table view from data in an unarchiver.

### Reusing cells

[`reuseIdentifier`](/documentation/UIKit/UITableViewCell/reuseIdentifier)

A string for identifying a reusable cell.

[`-  prepareForReuse`](/documentation/UIKit/UITableViewCell/prepareForReuse())

Prepares a reusable cell for reuse by the table view’s delegate.

### Configuring the background

[`defaultBackgroundConfiguration()`](/documentation/UIKit/UITableViewCell/defaultBackgroundConfiguration())

Retrieves a background configuration with system default values.

[`backgroundConfiguration`](/documentation/UIKit/UITableViewCell/backgroundConfiguration-24e8e)

The current background configuration of the cell.

[`-  defaultBackgroundConfiguration`](/documentation/UIKit/UITableViewCell/defaultBackgroundConfiguration)

Retrieves a background configuration with system default values.

[`backgroundConfiguration`](/documentation/UIKit/UITableViewCell/backgroundConfiguration-93a2v)

The current background configuration of the cell.

[`automaticallyUpdatesBackgroundConfiguration`](/documentation/UIKit/UITableViewCell/automaticallyUpdatesBackgroundConfiguration)

A Boolean value that determines whether the cell automatically updates its background configuration when its state changes.

[`backgroundView`](/documentation/UIKit/UITableViewCell/backgroundView)

The view to use as the background of the cell.

[`selectedBackgroundView`](/documentation/UIKit/UITableViewCell/selectedBackgroundView)

The view to use as the background for a selected cell.

[`multipleSelectionBackgroundView`](/documentation/UIKit/UITableViewCell/multipleSelectionBackgroundView)

The background view to use for a selected cell when the table view allows multiple row selections.

### Managing the content

[`defaultContentConfiguration()`](/documentation/UIKit/UITableViewCell/defaultContentConfiguration())

Retrieves a default list content configuration for the cell’s style.

[`contentConfiguration`](/documentation/UIKit/UITableViewCell/contentConfiguration-9ktox)

The current content configuration of the cell.

[`-  defaultContentConfiguration`](/documentation/UIKit/UITableViewCell/defaultContentConfiguration)

Retrieves a default list content configuration for the cell’s style.

[`contentConfiguration`](/documentation/UIKit/UITableViewCell/contentConfiguration-2lzvp)

The current content configuration of the cell.

[`automaticallyUpdatesContentConfiguration`](/documentation/UIKit/UITableViewCell/automaticallyUpdatesContentConfiguration)

A Boolean value that determines whether the cell automatically updates its content configuration when its state changes.

[`contentView`](/documentation/UIKit/UITableViewCell/contentView)

The content view of the cell object.

### Managing the state

[`configurationState`](/documentation/UIKit/UITableViewCell/configurationState-4xwj0)

The current configuration state of the cell.

[`configurationState`](/documentation/UIKit/UITableViewCell/configurationState-5gw4n)

The current configuration state of the cell.

[`-  setNeedsUpdateConfiguration`](/documentation/UIKit/UITableViewCell/setNeedsUpdateConfiguration())

Informs the cell to update its configuration for its current state.

[`updateConfiguration(using:)`](/documentation/UIKit/UITableViewCell/updateConfiguration(using:))

Updates the cell’s configuration using the current state.

[`configurationUpdateHandler`](/documentation/UIKit/UITableViewCell/configurationUpdateHandler-974)

A block for handling updates to the cell’s configuration using the current state.

[`ConfigurationUpdateHandler`](/documentation/UIKit/UITableViewCell/ConfigurationUpdateHandler-swift.typealias)

The type of block for handling updates to the cell’s configuration using the current state.

[`-  updateConfigurationUsingState:`](/documentation/UIKit/UITableViewCell/updateConfigurationUsingState:)

Updates the cell’s configuration using the current state.

[`configurationUpdateHandler`](/documentation/UIKit/UITableViewCell/configurationUpdateHandler-746ya)

A block for handling updates to the cell’s configuration using the current state.

[`UITableViewCellConfigurationUpdateHandler`](/documentation/UIKit/UITableViewCellConfigurationUpdateHandler)

The type of block for handling updates to the cell’s configuration using the current state.

### Managing accessory views

[`accessoryType`](/documentation/UIKit/UITableViewCell/accessoryType-swift.property)

The type of standard accessory view for the cell to use in the table view’s normal state.

[`accessoryView`](/documentation/UIKit/UITableViewCell/accessoryView)

The view to use on the right side of the cell, typically as a control, in the table view’s normal state.

[`editingAccessoryType`](/documentation/UIKit/UITableViewCell/editingAccessoryType)

The type of standard accessory view for the cell to use in the table view’s editing state.

[`editingAccessoryView`](/documentation/UIKit/UITableViewCell/editingAccessoryView)

The view to use on the right side of the cell, typically as a control, in the table view’s editing state.

[`AccessoryType`](/documentation/UIKit/UITableViewCell/AccessoryType-swift.enum)

The type of standard accessory control used by a cell.

### Managing cell selection and highlighting

[`selectionStyle`](/documentation/UIKit/UITableViewCell/selectionStyle-swift.property)

The style of selection for a cell.

[`SelectionStyle`](/documentation/UIKit/UITableViewCell/SelectionStyle-swift.enum)

The style of selected cells.

[`selected`](/documentation/UIKit/UITableViewCell/isSelected)

A Boolean value that indicates whether the cell is selected.

[`-  setSelected:animated:`](/documentation/UIKit/UITableViewCell/setSelected(_:animated:))

Sets the selected state of the cell, optionally animating the transition between states.

[`highlighted`](/documentation/UIKit/UITableViewCell/isHighlighted)

A Boolean value that indicates whether the cell is highlighted.

[`-  setHighlighted:animated:`](/documentation/UIKit/UITableViewCell/setHighlighted(_:animated:))

Sets the highlighted state of the cell, optionally animating the transition between states.

### Editing the cell

[`editing`](/documentation/UIKit/UITableViewCell/isEditing)

A Boolean value that indicates whether the cell is in an editable state.

[`-  setEditing:animated:`](/documentation/UIKit/UITableViewCell/setEditing(_:animated:))

Toggles the cell into and out of editing mode.

[`editingStyle`](/documentation/UIKit/UITableViewCell/editingStyle-swift.property)

The editing style of the cell.

[`EditingStyle`](/documentation/UIKit/UITableViewCell/EditingStyle-swift.enum)

The editing control used by a cell.

[`showingDeleteConfirmation`](/documentation/UIKit/UITableViewCell/showingDeleteConfirmation)

A Boolean value that indicates whether the cell is currently showing the delete-confirmation button.

[`showsReorderControl`](/documentation/UIKit/UITableViewCell/showsReorderControl)

A Boolean value that determines whether the cell shows the reordering control.

### Dragging the row

[`userInteractionEnabledWhileDragging`](/documentation/UIKit/UITableViewCell/userInteractionEnabledWhileDragging)

A Boolean value indicating whether users can interact with a cell while it is being dragged.

[`-  dragStateDidChange:`](/documentation/UIKit/UITableViewCell/dragStateDidChange(_:))

Notifies the cell that its drag status changed.

[`DragState`](/documentation/UIKit/UITableViewCell/DragState)

Constants indicating the current state of a row involved in a drag operation.

### Adjusting to state transitions

[`-  willTransitionToState:`](/documentation/UIKit/UITableViewCell/willTransition(to:))

Notifies the cell that it’s about to transition to a new cell state.

[`-  didTransitionToState:`](/documentation/UIKit/UITableViewCell/didTransition(to:))

Notifies the cell that it transitioned to a new cell state.

[`StateMask`](/documentation/UIKit/UITableViewCell/StateMask)

Constants used to determine the new state of a cell as it transitions between states.

### Managing content indentation

[`indentationLevel`](/documentation/UIKit/UITableViewCell/indentationLevel)

The indentation level of the cell’s content.

[`indentationWidth`](/documentation/UIKit/UITableViewCell/indentationWidth)

The width for each level of indentation of a cell’s content.

[`shouldIndentWhileEditing`](/documentation/UIKit/UITableViewCell/shouldIndentWhileEditing)

A Boolean value that controls whether the cell background is indented when the table view is in editing mode.

[`separatorInset`](/documentation/UIKit/UITableViewCell/separatorInset)

The inset values for the separator line drawn beneath the cell.

[`SeparatorStyle`](/documentation/UIKit/UITableViewCell/SeparatorStyle)

The style for cells to use as separators.

### Managing focus

[`focusStyle`](/documentation/UIKit/UITableViewCell/focusStyle-swift.property)

The appearance of the cell when focused.

[`FocusStyle`](/documentation/UIKit/UITableViewCell/FocusStyle-swift.enum)

The style of focused cells.

### Deprecated

[`textLabel`](/documentation/UIKit/UITableViewCell/textLabel)

The label to use for the main textual content of the table cell.

[`detailTextLabel`](/documentation/UIKit/UITableViewCell/detailTextLabel)

The secondary label of the table cell, if one exists.

[`imageView`](/documentation/UIKit/UITableViewCell/imageView)

The image view of the table cell.

[`-  initWithFrame:reuseIdentifier:`](/documentation/UIKit/UITableViewCell/initWithFrame:reuseIdentifier:)

Initializes and returns a table cell object.

[`text`](/documentation/UIKit/UITableViewCell/text)

The text of the cell.

[`font`](/documentation/UIKit/UITableViewCell/font)

The font of the title.

[`textAlignment`](/documentation/UIKit/UITableViewCell/textAlignment)

A constant that specifies the alignment of text in the cell.

[`textColor`](/documentation/UIKit/UITableViewCell/textColor)

The color of the title text.

[`selectedTextColor`](/documentation/UIKit/UITableViewCell/selectedTextColor)

The color of the title text when the cell is selected.

[`lineBreakMode`](/documentation/UIKit/UITableViewCell/lineBreakMode)

The mode for wrapping and truncating text in the cell.

[`image`](/documentation/UIKit/UITableViewCell/image)

The image to use as content for the cell.

[`selectedImage`](/documentation/UIKit/UITableViewCell/selectedImage)

The image to use a cell content when the cell is selected.

[`hidesAccessoryWhenEditing`](/documentation/UIKit/UITableViewCell/hidesAccessoryWhenEditing)

A Boolean value that determines whether the accessory view is hidden when the cell is being edited.

[`target`](/documentation/UIKit/UITableViewCell/target)

The target object to receive action messages.

[`editAction`](/documentation/UIKit/UITableViewCell/editAction)

The selector defining the action message to invoke when users tap the insert or delete button.

[`accessoryAction`](/documentation/UIKit/UITableViewCell/accessoryAction)

The selector defining the action message to invoke when users tap the accessory view.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`UIResponderStandardEditActions`](/documentation/UIKit/UIResponderStandardEditActions)

[`CALayerDelegate`](/documentation/QuartzCore/CALayerDelegate)

[`UIDynamicItem`](/documentation/UIKit/UIDynamicItem)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`UIAppearanceContainer`](/documentation/UIKit/UIAppearanceContainer)

[`CLBodyIdentifiable`](/documentation/CoreLocation/CLBodyIdentifiable)

[`UITraitEnvironment`](/documentation/UIKit/UITraitEnvironment)

[`UIGestureRecognizerDelegate`](/documentation/UIKit/UIGestureRecognizerDelegate)

[`UIFocusItem`](/documentation/UIKit/UIFocusItem)

[`UIPasteConfigurationSupporting`](/documentation/UIKit/UIPasteConfigurationSupporting)

[`UIAccessibilityIdentification`](/documentation/UIKit/UIAccessibilityIdentification)

[`UILargeContentViewerItem`](/documentation/UIKit/UILargeContentViewerItem)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`UIPopoverPresentationControllerSourceItem`](/documentation/UIKit/UIPopoverPresentationControllerSourceItem)

[`UICoordinateSpace`](/documentation/UIKit/UICoordinateSpace)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`UIActivityItemsConfigurationProviding`](/documentation/UIKit/UIActivityItemsConfigurationProviding)

[`UIUserActivityRestoring`](/documentation/UIKit/UIUserActivityRestoring)

[`UIFocusItemContainer`](/documentation/UIKit/UIFocusItemContainer)

[`Hashable`](/documentation/Swift/Hashable)

[`NSTouchBarProvider`](/documentation/AppKit/NSTouchBarProvider)

[`UIAppearance`](/documentation/UIKit/UIAppearance)

[`UIFocusEnvironment`](/documentation/UIKit/UIFocusEnvironment)

[`Sendable`](/documentation/Swift/Sendable)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Equatable`](/documentation/Swift/Equatable)

[`UITraitChangeObservable-67e94`](/documentation/UIKit/UITraitChangeObservable-67e94)

[`CMBodyIdentifiable`](/documentation/CoreMotion/CMBodyIdentifiable)

### Inherits From

[`UIView`](/documentation/UIKit/UIView)

---

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)