How to do it...

  1. Let's start, as usual, by creating a new project with the Single View Application template with the name TableViewDemo.
  2. Click on the View Controller in the storyboard file and go to Editor | Embed In | Navigation Controller to add the current view controller as a root view controller to a UINavigationController.
  3. Now, drag UITableView from the Object Library and place it as a subview.
  1. Place the table at origin (0, 0) with the same size as the ViewController view.
  2. Change its constraints to the following:
      TableView.leading = superview.leading 
      TableView.top = superview.top 
      TableView.width = superview.width 
      TableView.height = superview.height 
  1. To let the table view know the information about the data to be displayed and trigger ...

Get iOS Programming Cookbook 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.