Displaying all cities

First, we have to update the storyboard. Then, we should write some code to feed the data into the UITableViewController:

  1. Open the Main.storyboard.
  2. Then, select the Table View Controller.
  3. Open the Identity Inspector (cmd + Alt + 3).
  4. Select the class value to be ViewController. This visual component will use our previous table's implementation.
In the Interface Builder, we can associate a custom class with any visual component. The only limitation is that the class should be derived from the default component class.
  1. Expand the Table View and select the Table View Cell. Open the Utilities panel (cmd + Alt + 4) and select the Attributes Inspector.

You have to set the cell identifier so that we can create as many copies ...

Get Learn Swift by Building Applications 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.