UITableView: The Backbone of iOS Lists

UITableView is the workhorse for displaying scrolling lists in iOS. It's used everywhere from Settings to Contacts. The footgun is forgetting to reuse cells, which causes massive memory usage and choppy scrolling, so always dequeue a reusable cell.
WHY IT EXISTS: Displaying a list with thousands of items is a memory nightmare. If an app created a unique view for every single item, it would quickly run out of memory and crash. UITableView was created to display vast amounts of data efficiently by only rendering what's visible on screen, plus a small buffer.
THE MENTAL MODEL: Think of a UITableView like a film strip projector. You have a long reel of film (your data source), but the projector only shows the few frames currently in the light gate (the screen). As you scroll, it doesn't create new film; it just swaps the content of the frames. These reusable frames are the table view's cells (UITableViewCell).
HOW IT WORKS: A UITableView coordinates with a data source and a delegate. The data source (conforming to the UITableViewDataSource protocol) provides the data: how many rows to show and the configured cell for each row. The delegate (UITableViewDelegate) handles user interactions like taps and customizations like row height. The core optimization is cell reuse. When a cell scrolls off-screen, it's not destroyed. It's placed in a reuse queue. When a new row needs to appear, the table view requests a recycled cell from this queue via dequeueReusableCell(withIdentifier:). Your code then just updates the content of this recycled cell, which is far cheaper than creating a new view from scratch.
WHEN TO USE IT: Use UITableView for any vertical, single-column list of items. It is the standard, highly-performant solution for classic master-detail interfaces, settings screens, contact lists, and simple feeds where each item is represented by a row.
WHEN NOT TO USE IT: Avoid UITableView for complex, multi-column, or grid-like layouts. While it can be forced to work, UICollectionView is the modern, more flexible tool for grids and non-linear layouts. For very simple, static lists (e.g., 3-5 fixed items), a UIStackView is often simpler. In SwiftUI, the declarative equivalent is the List view.
ONE CANONICAL EXAMPLE: The iOS Settings app is the quintessential UITableView. It features sections with headers ("General", "Display & Brightness"), different cell styles (some with toggles, some with disclosure chevrons), and static content mixed with dynamic lists. It showcases the core grouping and display capabilities of a table view.
Read the original → developer.apple.com
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.