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.
Interview question
What is the primary technical advantage of UITableView's cell reuse mechanism?
- a.It simplifies the process of applying different styles to various cell types.
- b.It ensures that all cells maintain a uniform height and layout.
- c.It allows for dynamic updates to cell content without reloading the entire table.
- d.It significantly reduces memory usage and improves scrolling fluidity by avoiding constant view creation.Correct
Why? this is the answer
The card emphasizes that cell reuse prevents a "memory nightmare" and is "far cheaper than creating a new view from scratch," directly addressing memory efficiency and performance. While other options might describe aspects of table view usage, they are not the core technical benefit of the reuse mechanism itself.
Just read this? Test yourself on what you have been reading.
Read the original → developer.apple.com
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on ios — each one lists the topics its interview covers.
See open roles