Laying Out the View

UITableView instances are, as the name suggests, views that present interactive tables on the iOS screen. The UITableView class descends from the UIScrollView class. This inheritance provides the up and down scrolling capabilities for the table. Like other views, UITableView instances define their boundaries through frames, and they can be children or parents of other views. To create a table view, you allocate it, initialize it with a frame or constrain it with Auto Layout, and then add all the bookkeeping details by assigning data source and delegate objects.

UITableViewControllers take care of the view layout work for you. The class creates a standard view controller and populates it with a single UITableView, sets its ...

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.