Adding Our First Table View

Now, let's add a UITableView into our UIViewController:

  1. Open Explore.storyboard.
  2. In the Utilities panel, in the filter field, type tableview; then, drag the Table View onto the scene:
    Adding Our First Table View
  3. Select the Pin icon and enter the following values:
    • Set all values under Add New Constraints to 0
    • Constrain to margins: unchecked
    • Update Frames: Items of New Constraints
  4. Now click on Add 4 Constraints.

Updating Our Edges

We now need to correct the gap at the top of our Table View:

Updating Our Edges
  1. With the View Controller selected (as opposed to the Table View), select ...

Get iOS 10 Programming for Beginners 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.