iOS 7
TableView
Settings App
iPad
User Interface Design

iOS 7 TableView like in Settings App on iPad

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions

Introduction

With the release of iOS 7, Apple reimagined the appearance and functionality of its mobile operating system, employing a flat design and adding many nuanced features. Amongst these changes was the re-design of the UITableView , a common UIKit component used for displaying lists of information. The TableView is a particularly prevalent component in apps that require structured data presentation, such as Apple's own Settings app on the iPad. This article delves into the intricacies of using a TableView in iOS, especially as seen in the Settings app on the iPad.

Anatomy of a TableView

A UITableView is essentially a vertically scrolling list that can be customized to fit the requirements of the app. For example, the Settings app uses it to present various configurable options in a hierarchical manner, capitalizing on the simplicity and intuitiveness of the TableView . Here are some of the core aspects:

  1. Sections and Rows: UITableView is divided into sections, with each section potentially having numerous rows. In the Settings app, these sections are used to categorize related settings, such as "Wi-Fi" and "Bluetooth" grouped under the "Network" section.
  2. Cells: Each row is represented by a UITableViewCell . These cells can be customized extensively, both in terms of layout and interactivity. For instance, in the Settings app, cells are often a mix of labels and switches or buttons.
  3. Header and Footer Views: Sections can have optional header and footer views. These are typically used in the Settings app for providing context or explanations about groups of settings.

Implementing a TableView

Creating and configuring a UITableView involves several key steps and structures in the UIKit framework:

1. TableView DataSource & Delegate

The UITableViewDataSource protocol is essential for feeding data to the table view. It requires the implementation of several methods, the most basic of which are:

  • tableView(_:numberOfRowsInSection:) : Returns the number of rows in a given section.
  • tableView(_:cellForRowAt:) : Configures and returns the cell for a specified row and section.

Meanwhile, the UITableViewDelegate protocol adds behavior customization, such as responding to row selections.


Related reading
Free course
Beginner
7 lessons
2 hours
Tackling System Design Interview Problems

A short course that equips you with the skills to approach system design interviews methodically.

Start the free course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions

All Rights Reserved.