---
title: UITableViewDelegate
framework: uikit
role: symbol
role_heading: Protocol
path: uikit/uitableviewdelegate
---

# UITableViewDelegate

Methods for managing selections, configuring section headers and footers, deleting and reordering cells, and performing other actions in a table view.

## Declaration

```swift
@MainActor protocol UITableViewDelegate : UIScrollViewDelegate
```

## Overview

Overview Use the methods of this protocol to manage the following features: Create and manage custom header and footer views. Specify custom heights for rows, headers, and footers. Provide height estimates for better scrolling support. Indent row content. Respond to row selections. Respond to swipes and other actions in table rows. Support editing the table’s content. The table view specifies rows and sections using IndexPath. For information about how to interpret row and section indexes, see Specify the location of rows and sections.

## Topics

### Configuring rows for the table view

- [tableView(_:willDisplay:forRowAt:)](uikit/uitableviewdelegate/tableview(_:willdisplay:forrowat:).md)
- [tableView(_:indentationLevelForRowAt:)](uikit/uitableviewdelegate/tableview(_:indentationlevelforrowat:).md)
- [tableView(_:shouldSpringLoadRowAt:with:)](uikit/uitableviewdelegate/tableview(_:shouldspringloadrowat:with:).md)

### Responding to row selections

- [Handling row selection in a table view](uikit/handling-row-selection-in-a-table-view.md)
- [Selecting multiple items with a two-finger pan gesture](uikit/selecting-multiple-items-with-a-two-finger-pan-gesture.md)
- [tableView(_:willSelectRowAt:)](uikit/uitableviewdelegate/tableview(_:willselectrowat:).md)
- [tableView(_:didSelectRowAt:)](uikit/uitableviewdelegate/tableview(_:didselectrowat:).md)
- [tableView(_:willDeselectRowAt:)](uikit/uitableviewdelegate/tableview(_:willdeselectrowat:).md)
- [tableView(_:didDeselectRowAt:)](uikit/uitableviewdelegate/tableview(_:diddeselectrowat:).md)
- [tableView(_:shouldBeginMultipleSelectionInteractionAt:)](uikit/uitableviewdelegate/tableview(_:shouldbeginmultipleselectioninteractionat:).md)
- [tableView(_:didBeginMultipleSelectionInteractionAt:)](uikit/uitableviewdelegate/tableview(_:didbeginmultipleselectioninteractionat:).md)
- [tableViewDidEndMultipleSelectionInteraction(_:)](uikit/uitableviewdelegate/tableviewdidendmultipleselectioninteraction(_:).md)

### Providing custom header and footer views

- [tableView(_:viewForHeaderInSection:)](uikit/uitableviewdelegate/tableview(_:viewforheaderinsection:).md)
- [tableView(_:viewForFooterInSection:)](uikit/uitableviewdelegate/tableview(_:viewforfooterinsection:).md)
- [tableView(_:willDisplayHeaderView:forSection:)](uikit/uitableviewdelegate/tableview(_:willdisplayheaderview:forsection:).md)
- [tableView(_:willDisplayFooterView:forSection:)](uikit/uitableviewdelegate/tableview(_:willdisplayfooterview:forsection:).md)

### Providing header, footer, and row heights

- [tableView(_:heightForRowAt:)](uikit/uitableviewdelegate/tableview(_:heightforrowat:).md)
- [tableView(_:heightForHeaderInSection:)](uikit/uitableviewdelegate/tableview(_:heightforheaderinsection:).md)
- [tableView(_:heightForFooterInSection:)](uikit/uitableviewdelegate/tableview(_:heightforfooterinsection:).md)
- [automaticDimension](uikit/uitableview/automaticdimension.md)

### Estimating heights for the table’s content

- [tableView(_:estimatedHeightForRowAt:)](uikit/uitableviewdelegate/tableview(_:estimatedheightforrowat:).md)
- [tableView(_:estimatedHeightForHeaderInSection:)](uikit/uitableviewdelegate/tableview(_:estimatedheightforheaderinsection:).md)
- [tableView(_:estimatedHeightForFooterInSection:)](uikit/uitableviewdelegate/tableview(_:estimatedheightforfooterinsection:).md)

### Managing accessory views

- [tableView(_:accessoryButtonTappedForRowWith:)](uikit/uitableviewdelegate/tableview(_:accessorybuttontappedforrowwith:).md)

### Managing context menus

- [Adding context menus in your app](uikit/adding-context-menus-in-your-app.md)
- [tableView(_:contextMenuConfigurationForRowAt:point:)](uikit/uitableviewdelegate/tableview(_:contextmenuconfigurationforrowat:point:).md)
- [tableView(_:previewForDismissingContextMenuWithConfiguration:)](uikit/uitableviewdelegate/tableview(_:previewfordismissingcontextmenuwithconfiguration:).md)
- [tableView(_:previewForHighlightingContextMenuWithConfiguration:)](uikit/uitableviewdelegate/tableview(_:previewforhighlightingcontextmenuwithconfiguration:).md)
- [tableView(_:willDisplayContextMenu:animator:)](uikit/uitableviewdelegate/tableview(_:willdisplaycontextmenu:animator:).md)
- [tableView(_:willEndContextMenuInteraction:animator:)](uikit/uitableviewdelegate/tableview(_:willendcontextmenuinteraction:animator:).md)
- [tableView(_:willPerformPreviewActionForMenuWith:animator:)](uikit/uitableviewdelegate/tableview(_:willperformpreviewactionformenuwith:animator:).md)

### Responding to row actions

- [tableView(_:leadingSwipeActionsConfigurationForRowAt:)](uikit/uitableviewdelegate/tableview(_:leadingswipeactionsconfigurationforrowat:).md)
- [tableView(_:trailingSwipeActionsConfigurationForRowAt:)](uikit/uitableviewdelegate/tableview(_:trailingswipeactionsconfigurationforrowat:).md)
- [tableView(_:shouldShowMenuForRowAt:)](uikit/uitableviewdelegate/tableview(_:shouldshowmenuforrowat:).md)
- [tableView(_:canPerformAction:forRowAt:withSender:)](uikit/uitableviewdelegate/tableview(_:canperformaction:forrowat:withsender:).md)
- [tableView(_:performAction:forRowAt:withSender:)](uikit/uitableviewdelegate/tableview(_:performaction:forrowat:withsender:).md)
- [tableView(_:editActionsForRowAt:)](uikit/uitableviewdelegate/tableview(_:editactionsforrowat:).md)

### Managing table view highlights

- [tableView(_:shouldHighlightRowAt:)](uikit/uitableviewdelegate/tableview(_:shouldhighlightrowat:).md)
- [tableView(_:didHighlightRowAt:)](uikit/uitableviewdelegate/tableview(_:didhighlightrowat:).md)
- [tableView(_:didUnhighlightRowAt:)](uikit/uitableviewdelegate/tableview(_:didunhighlightrowat:).md)

### Editing table rows

- [tableView(_:willBeginEditingRowAt:)](uikit/uitableviewdelegate/tableview(_:willbegineditingrowat:).md)
- [tableView(_:didEndEditingRowAt:)](uikit/uitableviewdelegate/tableview(_:didendeditingrowat:).md)
- [tableView(_:editingStyleForRowAt:)](uikit/uitableviewdelegate/tableview(_:editingstyleforrowat:).md)
- [tableView(_:titleForDeleteConfirmationButtonForRowAt:)](uikit/uitableviewdelegate/tableview(_:titlefordeleteconfirmationbuttonforrowat:).md)
- [tableView(_:shouldIndentWhileEditingRowAt:)](uikit/uitableviewdelegate/tableview(_:shouldindentwhileeditingrowat:).md)

### Reordering table rows

- [tableView(_:targetIndexPathForMoveFromRowAt:toProposedIndexPath:)](uikit/uitableviewdelegate/tableview(_:targetindexpathformovefromrowat:toproposedindexpath:).md)

### Tracking the removal of views

- [tableView(_:didEndDisplaying:forRowAt:)](uikit/uitableviewdelegate/tableview(_:didenddisplaying:forrowat:).md)
- [tableView(_:didEndDisplayingHeaderView:forSection:)](uikit/uitableviewdelegate/tableview(_:didenddisplayingheaderview:forsection:).md)
- [tableView(_:didEndDisplayingFooterView:forSection:)](uikit/uitableviewdelegate/tableview(_:didenddisplayingfooterview:forsection:).md)

### Managing table view focus

- [tableView(_:canFocusRowAt:)](uikit/uitableviewdelegate/tableview(_:canfocusrowat:).md)
- [tableView(_:shouldUpdateFocusIn:)](uikit/uitableviewdelegate/tableview(_:shouldupdatefocusin:).md)
- [tableView(_:didUpdateFocusIn:with:)](uikit/uitableviewdelegate/tableview(_:didupdatefocusin:with:).md)
- [indexPathForPreferredFocusedView(in:)](uikit/uitableviewdelegate/indexpathforpreferredfocusedview(in:).md)
- [tableView(_:selectionFollowsFocusForRowAt:)](uikit/uitableviewdelegate/tableview(_:selectionfollowsfocusforrowat:).md)

### Performing primary actions

- [tableView(_:canPerformPrimaryActionForRowAt:)](uikit/uitableviewdelegate/tableview(_:canperformprimaryactionforrowat:).md)
- [tableView(_:performPrimaryActionForRowAt:)](uikit/uitableviewdelegate/tableview(_:performprimaryactionforrowat:).md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [UIScrollViewDelegate](uikit/uiscrollviewdelegate.md)

### Conforming Types

- [UITableViewController](uikit/uitableviewcontroller.md)

## See Also

### Table management

- [Estimating the height of a table’s scrolling area](uikit/estimating-the-height-of-a-table-s-scrolling-area.md)
- [UITableViewController](uikit/uitableviewcontroller.md)
- [UITableViewFocusUpdateContext](uikit/uitableviewfocusupdatecontext.md)
