<!--
{
  "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

[`init(style: UITableViewCell.CellStyle, reuseIdentifier: String?)`](/documentation/UIKit/UITableViewCell/init(style:reuseIdentifier:))

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

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

An enumeration for the various styles of cells.

[`init?(coder: NSCoder)`](/documentation/UIKit/UITableViewCell/init(coder:))

Creates a table view from data in an unarchiver.

### Reusing cells

[`var reuseIdentifier: String?`](/documentation/UIKit/UITableViewCell/reuseIdentifier)

A string for identifying a reusable cell.

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

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

### Configuring the background

[`func defaultBackgroundConfiguration() -> UIBackgroundConfiguration`](/documentation/UIKit/UITableViewCell/defaultBackgroundConfiguration())

Retrieves a background configuration with system default values.

[`var backgroundConfiguration: UIBackgroundConfiguration?`](/documentation/UIKit/UITableViewCell/backgroundConfiguration-24e8e)

The current background configuration of the cell.

[`- (UIBackgroundConfiguration *) defaultBackgroundConfiguration;`](/documentation/UIKit/UITableViewCell/defaultBackgroundConfiguration)

Retrieves a background configuration with system default values.

[`@property (nonatomic, copy, nullable) UIBackgroundConfiguration * backgroundConfiguration;`](/documentation/UIKit/UITableViewCell/backgroundConfiguration-93a2v)

The current background configuration of the cell.

[`var automaticallyUpdatesBackgroundConfiguration: Bool`](/documentation/UIKit/UITableViewCell/automaticallyUpdatesBackgroundConfiguration)

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

[`var backgroundView: UIView?`](/documentation/UIKit/UITableViewCell/backgroundView)

The view to use as the background of the cell.

[`var selectedBackgroundView: UIView?`](/documentation/UIKit/UITableViewCell/selectedBackgroundView)

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

[`var multipleSelectionBackgroundView: UIView?`](/documentation/UIKit/UITableViewCell/multipleSelectionBackgroundView)

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

### Managing the content

[`func defaultContentConfiguration() -> UIListContentConfiguration`](/documentation/UIKit/UITableViewCell/defaultContentConfiguration())

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

[`var contentConfiguration: (any UIContentConfiguration)?`](/documentation/UIKit/UITableViewCell/contentConfiguration-9ktox)

The current content configuration of the cell.

[`- (UIListContentConfiguration *) defaultContentConfiguration;`](/documentation/UIKit/UITableViewCell/defaultContentConfiguration)

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

[`@property (nonatomic, copy, nullable) id<UIContentConfiguration> contentConfiguration;`](/documentation/UIKit/UITableViewCell/contentConfiguration-2lzvp)

The current content configuration of the cell.

[`var automaticallyUpdatesContentConfiguration: Bool`](/documentation/UIKit/UITableViewCell/automaticallyUpdatesContentConfiguration)

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

[`var contentView: UIView`](/documentation/UIKit/UITableViewCell/contentView)

The content view of the cell object.

### Managing the state

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

The current configuration state of the cell.

[`@property (nonatomic, readonly) UICellConfigurationState * configurationState;`](/documentation/UIKit/UITableViewCell/configurationState-5gw4n)

The current configuration state of the cell.

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

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

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

Updates the cell’s configuration using the current state.

[`var configurationUpdateHandler: UITableViewCell.ConfigurationUpdateHandler?`](/documentation/UIKit/UITableViewCell/configurationUpdateHandler-974)

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

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

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

[`- (void) updateConfigurationUsingState:(UICellConfigurationState *) state;`](/documentation/UIKit/UITableViewCell/updateConfigurationUsingState:)

Updates the cell’s configuration using the current state.

[`@property (nonatomic, copy, nullable) UITableViewCellConfigurationUpdateHandler configurationUpdateHandler;`](/documentation/UIKit/UITableViewCell/configurationUpdateHandler-746ya)

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

[`typedef void (^)(__kindof UITableViewCell *, UICellConfigurationState *) UITableViewCellConfigurationUpdateHandler;`](/documentation/UIKit/UITableViewCellConfigurationUpdateHandler)

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

### Managing accessory views

[`var accessoryType: UITableViewCell.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.

[`var accessoryView: UIView?`](/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.

[`var editingAccessoryType: UITableViewCell.AccessoryType`](/documentation/UIKit/UITableViewCell/editingAccessoryType)

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

[`var editingAccessoryView: UIView?`](/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.

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

The type of standard accessory control used by a cell.

### Managing cell selection and highlighting

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

The style of selection for a cell.

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

The style of selected cells.

[`var isSelected: Bool`](/documentation/UIKit/UITableViewCell/isSelected)

A Boolean value that indicates whether the cell is selected.

[`func setSelected(Bool, animated: Bool)`](/documentation/UIKit/UITableViewCell/setSelected(_:animated:))

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

[`var isHighlighted: Bool`](/documentation/UIKit/UITableViewCell/isHighlighted)

A Boolean value that indicates whether the cell is highlighted.

[`func setHighlighted(Bool, animated: Bool)`](/documentation/UIKit/UITableViewCell/setHighlighted(_:animated:))

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

### Editing the cell

[`var isEditing: Bool`](/documentation/UIKit/UITableViewCell/isEditing)

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

[`func setEditing(Bool, animated: Bool)`](/documentation/UIKit/UITableViewCell/setEditing(_:animated:))

Toggles the cell into and out of editing mode.

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

The editing style of the cell.

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

The editing control used by a cell.

[`var showingDeleteConfirmation: Bool`](/documentation/UIKit/UITableViewCell/showingDeleteConfirmation)

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

[`var showsReorderControl: Bool`](/documentation/UIKit/UITableViewCell/showsReorderControl)

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

### Dragging the row

[`var userInteractionEnabledWhileDragging: Bool`](/documentation/UIKit/UITableViewCell/userInteractionEnabledWhileDragging)

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

[`func dragStateDidChange(UITableViewCell.DragState)`](/documentation/UIKit/UITableViewCell/dragStateDidChange(_:))

Notifies the cell that its drag status changed.

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

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

### Adjusting to state transitions

[`func willTransition(to: UITableViewCell.StateMask)`](/documentation/UIKit/UITableViewCell/willTransition(to:))

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

[`func didTransition(to: UITableViewCell.StateMask)`](/documentation/UIKit/UITableViewCell/didTransition(to:))

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

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

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

### Managing content indentation

[`var indentationLevel: Int`](/documentation/UIKit/UITableViewCell/indentationLevel)

The indentation level of the cell’s content.

[`var indentationWidth: CGFloat`](/documentation/UIKit/UITableViewCell/indentationWidth)

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

[`var shouldIndentWhileEditing: Bool`](/documentation/UIKit/UITableViewCell/shouldIndentWhileEditing)

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

[`var separatorInset: UIEdgeInsets`](/documentation/UIKit/UITableViewCell/separatorInset)

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

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

The style for cells to use as separators.

### Managing focus

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

The appearance of the cell when focused.

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

The style of focused cells.

### Deprecated

[Deprecated symbols](/documentation/UIKit/uitableviewcell-deprecated-symbols)

Review symbols that are no longer in active development, and their recommended replacements.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

### 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)