How to create a list
Creating lists is very common in the real world, as well as in software applications. A list in a software application can be used for a variety of things, such as creating a to-do list, showing a list of the most recent news, or showing the items on the menu of your local pizza joint:
A list in an iOS application is most commonly implemented, and referred to, as a table view. A table view refers to the UITableView
UI element, which is the view that gives us a list of horizontal items. Each item in the list is referred to as a cell due to its type being UITableViewCell
. A cell comes with a set of predefined formats, but custom cells can also be created to fit the developer's needs. Further, a list can be divided into sections, for example, by the first letter of a contact's last name, as in the preinstalled Contacts app that ships with iOS:
Besides setting up the interface to include the UITableView
, a set of methods...