Table views
Display data in a single column of customizable rows.
Overview
A table view displays a single column of vertically scrolling content, divided into rows and sections. Each row of a table displays a single piece of information related to your app. Sections let you group related rows together. For example, the Contacts app uses a table to display the names of the user’s contacts.
[Image]
Table views are a collaboration between many different objects, including:
Cells. A cell provides the visual representation for your content. You can use the default cells provided by UIKit or define custom cells to suit the needs of your app.
Table view controller. You typically use a UITableViewController object to manage a table view. You can use other view controllers too, but a table view controller is required for some table-related features to work.
Your data source object. This object adopts the UITableViewDataSource protocol and provides the data for the table.
Your delegate object. This object adopts the UITableViewDelegate protocol and manages user interactions with the table’s contents.
Topics
Essentials
Data
Filling a table with dataAsynchronously loading images into table and collection viewsUITableViewDataSourceUITableViewDataSourcePrefetchingUITableViewDiffableDataSourceNSDiffableDataSourceSnapshotUILocalizedIndexedCollationUIDataSourceTranslatingUIRefreshControl
Table management
Estimating the height of a table’s scrolling areaUITableViewControllerUITableViewDelegateUITableViewFocusUpdateContext
Cells, headers, and footers
Configuring the cells for your tableCreating self-sizing table view cellsAdding headers and footers to table sectionsUITableViewCellUITableViewHeaderFooterView
Row actions
Selection management
Drag and drop
Supporting drag and drop in table viewsAdopting drag and drop in a table viewUITableViewDragDelegateUITableViewDropDelegateUITableViewDropCoordinatorUITableViewDropItemUITableViewDropProposal