Open the ExploreViewController.swift file, and inside the private extension, add the following method above the unwindLocationCancel() method:
func showLocationList(segue:UIStoryboardSegue) { guard let navController = segue.destination as? UINavigationController, let viewController = navController.topViewController as? LocationViewController else { return } guard let city = selectedCity else { return } viewController.selectedCity = city}
Our showLocationList() method will be called whenever our destination view has a Navigation Controller. Then, it checks to see if the topViewController is of the LocationViewController class. If either of these two statements are false, we do nothing. ...