Currently, we have no way to communicate with our Table View and our Location View Controller. Let's see how we can connect these two:
- Open the LocationViewController.swift file and add the following code after the class declaration:
@IBOutlet weak var tableView:UITableView!
- Save the file by hitting command + S. Your file should look like the following, with an empty circle next to the variable:
Before we get started, we are going to clean up our LocationViewController.swift file. Delete everything after viewDidLoad():
Next, let's connect our table view to the file:
- Open Locations.storyboard again and make sure that you have the Location View Controller selected in the Outline view.
- Then, in the Utilities Panel, select Connections inspector. Under the Outlets section, you will see an empty circle, tableView...