1️⃣What is a UITableView?

Fall 2023 | Vin Bui

So far, we only created static, non-moving views. However, many apps today have views that are scrollable. One way to implement a scrollable view with UIKit is with a UITableView.

What is a UITableView?

A UITableView is a subclass of UIScrollView which is a view that users can scroll through. We can think of a UITableView as a list of data. Each item inside of this list is represented by a view called a UITableViewCell. Each cell tends to look very similar to one another but are holding different data.

Examples of a UITableView

Breaking Down a UITableView

A UITableView contains sections where each section contains rows, and each row being represented by a cell. Let’s take a look at Settings:

As we can see, a UITableView can contain as many sections as it wants, and each section can contain as many rows as it wants. The rows are represented by a UITableViewCell which is a view. In the image above, we can see that each cell looks very similar to one another. Each cell contains a UIImageView representing the icon as well as a UILabel describing that cell. In the next section of this chapter, we’ll learn how to create these custom cells.

Last updated