---
title: UITableView
framework: uikit
role: symbol
role_heading: Class
path: uikit/uitableview
---

# UITableView

A view that presents data using rows in a single column.

## Declaration

```swift
@MainActor class UITableView
```

## Mentioned in

About app development with UIKit Adding headers and footers to table sections Configuring the cells for your table Estimating the height of a table’s scrolling area Making a view into a drag source Making a view into a drop destination

## Overview

Overview Table views in iOS display rows of vertically scrolling content in a single column. Each row in the table contains one piece of your app’s content. You can configure a table to display a single long list of rows, or you can group related rows into sections to make navigating the content easier. When you organize rows into sections in a table, you can choose to present sections in a plain or grouped visual UITableView.Style. For example, the Contacts app displays the name of each contact in a separate row, organized into sections by the first letter of each contact’s last name. It presents the sections with a plain style. The main page of the Settings app displays the available settings organized into related sections, and presents those sections in a grouped visual style. Tables are common in apps with data that’s highly structured or organized hierarchically. Apps that contain hierarchical data often use tables in conjunction with a navigation view controller, which facilitates navigation between different levels of the hierarchy. For example, the Settings app uses tables and a navigation controller to organize the system settings. UITableView manages the basic appearance of the table, but your app provides the cells (UITableViewCell objects) that display the actual content. The standard cell configurations display a simple combination of text and images, but you can define custom cells that display any content you want. You can also supply header and footer views to provide additional information for groups of cells. Add a table view to your interface To add a table view to your interface, drag a table view controller (UITableViewController) object to your storyboard. Xcode creates a new scene that includes both the view controller and a table view, ready for you to configure and use. Table views are data-driven, normally getting their data from a data source object that you provide. The data source object manages your app’s data and is responsible for creating and configuring the table’s cells. If the content of your table never changes, you can configure that content in your storyboard file instead. For information about how to specify your table’s data, see Filling a table with data. Save and restore the table’s current state Table views support UIKit app restoration. To save and restore the table’s data, assign a nonempty value to the table view’s restorationIdentifier property. When you save its parent view controller, the table view automatically saves the index paths for the currently selected and visible rows. If the table’s data source object adopts the UIDataSourceModelAssociation protocol, the table stores the unique IDs that you provide for those items instead of their index paths. For information about how to save and restore your app’s state information, see Preserving your app’s UI across launches.

## Topics

### Creating a table view

- [init(frame:style:)](uikit/uitableview/init(frame:style:).md)
- [init(coder:)](uikit/uitableview/init(coder:).md)

### Providing the data and cells

- [dataSource](uikit/uitableview/datasource.md)
- [prefetchDataSource](uikit/uitableview/prefetchdatasource.md)
- [isPrefetchingEnabled](uikit/uitableview/isprefetchingenabled.md)
- [UITableViewDataSource](uikit/uitableviewdatasource.md)
- [UITableViewDataSourcePrefetching](uikit/uitableviewdatasourceprefetching.md)

### Recycling table view cells

- [register(_:forCellReuseIdentifier:)](uikit/uitableview/register(_:forcellreuseidentifier:)-5q6bo.md)
- [register(_:forCellReuseIdentifier:)](uikit/uitableview/register(_:forcellreuseidentifier:)-3l3ct.md)
- [dequeueReusableCell(withIdentifier:for:)](uikit/uitableview/dequeuereusablecell(withidentifier:for:).md)
- [dequeueReusableCell(withIdentifier:)](uikit/uitableview/dequeuereusablecell(withidentifier:).md)

### Recycling section headers and footers

- [register(_:forHeaderFooterViewReuseIdentifier:)](uikit/uitableview/register(_:forheaderfooterviewreuseidentifier:)-1rgvc.md)
- [register(_:forHeaderFooterViewReuseIdentifier:)](uikit/uitableview/register(_:forheaderfooterviewreuseidentifier:)-20ybb.md)
- [dequeueReusableHeaderFooterView(withIdentifier:)](uikit/uitableview/dequeuereusableheaderfooterview(withidentifier:).md)

### Managing interactions with the table

- [delegate](uikit/uitableview/delegate.md)
- [UITableViewDelegate](uikit/uitableviewdelegate.md)

### Configuring the table’s appearance

- [style](uikit/uitableview/style-swift.property.md)
- [UITableView.Style](uikit/uitableview/style-swift.enum.md)
- [tableHeaderView](uikit/uitableview/tableheaderview.md)
- [tableFooterView](uikit/uitableview/tablefooterview.md)
- [backgroundView](uikit/uitableview/backgroundview.md)

### Configuring cell height and layout

- [rowHeight](uikit/uitableview/rowheight.md)
- [estimatedRowHeight](uikit/uitableview/estimatedrowheight.md)
- [fillerRowHeight](uikit/uitableview/fillerrowheight.md)
- [cellLayoutMarginsFollowReadableWidth](uikit/uitableview/celllayoutmarginsfollowreadablewidth.md)
- [insetsContentViewsToSafeArea](uikit/uitableview/insetscontentviewstosafearea.md)

### Configuring header and footer appearance

- [sectionHeaderHeight](uikit/uitableview/sectionheaderheight.md)
- [sectionFooterHeight](uikit/uitableview/sectionfooterheight.md)
- [estimatedSectionHeaderHeight](uikit/uitableview/estimatedsectionheaderheight.md)
- [estimatedSectionFooterHeight](uikit/uitableview/estimatedsectionfooterheight.md)
- [sectionHeaderTopPadding](uikit/uitableview/sectionheadertoppadding.md)

### Customizing the separator appearance

- [separatorStyle](uikit/uitableview/separatorstyle.md)
- [UITableViewCell.SeparatorStyle](uikit/uitableviewcell/separatorstyle.md)
- [separatorColor](uikit/uitableview/separatorcolor.md)
- [separatorEffect](uikit/uitableview/separatoreffect.md)
- [separatorInset](uikit/uitableview/separatorinset.md)
- [separatorInsetReference](uikit/uitableview/separatorinsetreference-swift.property.md)
- [UITableView.SeparatorInsetReference](uikit/uitableview/separatorinsetreference-swift.enum.md)

### Getting the number of rows and sections

- [numberOfRows(inSection:)](uikit/uitableview/numberofrows(insection:).md)
- [numberOfSections](uikit/uitableview/numberofsections.md)

### Getting cells and section-based views

- [cellForRow(at:)](uikit/uitableview/cellforrow(at:).md)
- [headerView(forSection:)](uikit/uitableview/headerview(forsection:).md)
- [footerView(forSection:)](uikit/uitableview/footerview(forsection:).md)
- [indexPath(for:)](uikit/uitableview/indexpath(for:).md)
- [indexPathForRow(at:)](uikit/uitableview/indexpathforrow(at:).md)
- [indexPathsForRows(in:)](uikit/uitableview/indexpathsforrows(in:).md)
- [visibleCells](uikit/uitableview/visiblecells.md)
- [indexPathsForVisibleRows](uikit/uitableview/indexpathsforvisiblerows.md)

### Selecting rows

- [indexPathForSelectedRow](uikit/uitableview/indexpathforselectedrow.md)
- [indexPathsForSelectedRows](uikit/uitableview/indexpathsforselectedrows.md)
- [selectRow(at:animated:scrollPosition:)](uikit/uitableview/selectrow(at:animated:scrollposition:).md)
- [deselectRow(at:animated:)](uikit/uitableview/deselectrow(at:animated:).md)
- [allowsSelection](uikit/uitableview/allowsselection.md)
- [allowsMultipleSelection](uikit/uitableview/allowsmultipleselection.md)
- [allowsSelectionDuringEditing](uikit/uitableview/allowsselectionduringediting.md)
- [allowsMultipleSelectionDuringEditing](uikit/uitableview/allowsmultipleselectionduringediting.md)
- [selectionFollowsFocus](uikit/uitableview/selectionfollowsfocus.md)
- [selectionDidChangeNotification](uikit/uitableview/selectiondidchangenotification.md)

### Inserting, deleting, and moving rows and sections

- [insertRows(at:with:)](uikit/uitableview/insertrows(at:with:).md)
- [deleteRows(at:with:)](uikit/uitableview/deleterows(at:with:).md)
- [insertSections(_:with:)](uikit/uitableview/insertsections(_:with:).md)
- [deleteSections(_:with:)](uikit/uitableview/deletesections(_:with:).md)
- [UITableView.RowAnimation](uikit/uitableview/rowanimation.md)
- [moveRow(at:to:)](uikit/uitableview/moverow(at:to:).md)
- [moveSection(_:toSection:)](uikit/uitableview/movesection(_:tosection:).md)

### Performing batch updates to rows and sections

- [performBatchUpdates(_:completion:)](uikit/uitableview/performbatchupdates(_:completion:).md)
- [beginUpdates()](uikit/uitableview/beginupdates().md)
- [endUpdates()](uikit/uitableview/endupdates().md)

### Reloading the table view

- [hasUncommittedUpdates](uikit/uitableview/hasuncommittedupdates.md)
- [reconfigureRows(at:)](uikit/uitableview/reconfigurerows(at:).md)
- [reloadData()](uikit/uitableview/reloaddata().md)
- [reloadRows(at:with:)](uikit/uitableview/reloadrows(at:with:).md)
- [reloadSections(_:with:)](uikit/uitableview/reloadsections(_:with:).md)
- [reloadSectionIndexTitles()](uikit/uitableview/reloadsectionindextitles().md)

### Managing drag interactions

- [dragDelegate](uikit/uitableview/dragdelegate.md)
- [UITableViewDragDelegate](uikit/uitableviewdragdelegate.md)
- [hasActiveDrag](uikit/uitableview/hasactivedrag.md)
- [dragInteractionEnabled](uikit/uitableview/draginteractionenabled.md)

### Managing drop interactions

- [dropDelegate](uikit/uitableview/dropdelegate.md)
- [UITableViewDropDelegate](uikit/uitableviewdropdelegate.md)
- [hasActiveDrop](uikit/uitableview/hasactivedrop.md)

### Scrolling the table view

- [scrollToRow(at:at:animated:)](uikit/uitableview/scrolltorow(at:at:animated:).md)
- [scrollToNearestSelectedRow(at:animated:)](uikit/uitableview/scrolltonearestselectedrow(at:animated:).md)
- [UITableView.ScrollPosition](uikit/uitableview/scrollposition.md)

### Putting the table into edit mode

- [setEditing(_:animated:)](uikit/uitableview/setediting(_:animated:).md)
- [isEditing](uikit/uitableview/isediting.md)

### Configuring the table index

- [sectionIndexMinimumDisplayRowCount](uikit/uitableview/sectionindexminimumdisplayrowcount.md)
- [sectionIndexColor](uikit/uitableview/sectionindexcolor.md)
- [sectionIndexBackgroundColor](uikit/uitableview/sectionindexbackgroundcolor.md)
- [sectionIndexTrackingBackgroundColor](uikit/uitableview/sectionindextrackingbackgroundcolor.md)
- [indexSearch](uikit/uitableview/indexsearch.md)

### Getting the drawing areas for the table

- [rect(forSection:)](uikit/uitableview/rect(forsection:).md)
- [rectForRow(at:)](uikit/uitableview/rectforrow(at:).md)
- [rectForFooter(inSection:)](uikit/uitableview/rectforfooter(insection:).md)
- [rectForHeader(inSection:)](uikit/uitableview/rectforheader(insection:).md)

### Working with focus

- [allowsFocus](uikit/uitableview/allowsfocus.md)
- [allowsFocusDuringEditing](uikit/uitableview/allowsfocusduringediting.md)
- [selectionFollowsFocus](uikit/uitableview/selectionfollowsfocus.md)
- [remembersLastFocusedIndexPath](uikit/uitableview/rememberslastfocusedindexpath.md)

### Managing context menus

- [contextMenuInteraction](uikit/uitableview/contextmenuinteraction.md)

### Resizing self-sizing cells

- [selfSizingInvalidation](uikit/uitableview/selfsizinginvalidation-swift.property.md)
- [UITableView.SelfSizingInvalidation](uikit/uitableview/selfsizinginvalidation-swift.enum.md)

### Managing content-hugging behavior

- [contentHuggingElements](uikit/uitableview/contenthuggingelements.md)
- [UITableViewContentHuggingElements](uikit/uitableviewcontenthuggingelements.md)

### Structures

- [UITableView.SelectionDidChangeMessage](uikit/uitableview/selectiondidchangemessage.md)

### Instance Properties

- [appIntentsDataSource](uikit/uitableview/appintentsdatasource.md)

## Relationships

### Inherits From

- [UIScrollView](uikit/uiscrollview.md)

### Conforms To

- [CALayerDelegate](quartzcore/calayerdelegate.md)
- [CLBodyIdentifiable](corelocation/clbodyidentifiable.md)
- [CMBodyIdentifiable](coremotion/cmbodyidentifiable.md)
- [CVarArg](swift/cvararg.md)
- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSTouchBarProvider](appkit/nstouchbarprovider.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [UIAccessibilityIdentification](uikit/uiaccessibilityidentification.md)
- [UIActivityItemsConfigurationProviding](uikit/uiactivityitemsconfigurationproviding.md)
- [UIAppearance](uikit/uiappearance.md)
- [UIAppearanceContainer](uikit/uiappearancecontainer.md)
- [UICoordinateSpace](uikit/uicoordinatespace.md)
- [UIDataSourceTranslating](uikit/uidatasourcetranslating.md)
- [UIDynamicItem](uikit/uidynamicitem.md)
- [UIFocusEnvironment](uikit/uifocusenvironment.md)
- [UIFocusItem](uikit/uifocusitem.md)
- [UIFocusItemContainer](uikit/uifocusitemcontainer.md)
- [UIFocusItemScrollableContainer](uikit/uifocusitemscrollablecontainer.md)
- [UILargeContentViewerItem](uikit/uilargecontentvieweritem.md)
- [UIPasteConfigurationSupporting](uikit/uipasteconfigurationsupporting.md)
- [UIPopoverPresentationControllerSourceItem](uikit/uipopoverpresentationcontrollersourceitem.md)
- [UIResponderStandardEditActions](uikit/uiresponderstandardeditactions.md)
- [UISpringLoadedInteractionSupporting](uikit/uispringloadedinteractionsupporting.md)
- [UITraitChangeObservable](uikit/uitraitchangeobservable-67e94.md)
- [UITraitEnvironment](uikit/uitraitenvironment.md)
- [UIUserActivityRestoring](uikit/uiuseractivityrestoring.md)
