From efbce8dda88958f5d675f5bf5d003c739882964f Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Thu, 13 Apr 2023 00:49:09 +0200 Subject: [PATCH] Implemented the "tableView(_: didSelectAt: )" function in the LocationsListViewController view controller. --- .../LocationsListViewController.swift | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Apps/Locations/Sources/Screens/LocationsList/LocationsListViewController.swift b/Apps/Locations/Sources/Screens/LocationsList/LocationsListViewController.swift index 16e17f4..5fb6e90 100644 --- a/Apps/Locations/Sources/Screens/LocationsList/LocationsListViewController.swift +++ b/Apps/Locations/Sources/Screens/LocationsList/LocationsListViewController.swift @@ -104,7 +104,20 @@ extension LocationsListViewController: UITableViewDataSource { // MARK: - UITableViewDelegate -extension LocationsListViewController: UITableViewDelegate {} +extension LocationsListViewController: UITableViewDelegate { + + // MARK: Functions + + func tableView( + _ tableView: UITableView, + didSelectRowAt indexPath: IndexPath + ) { + viewModel.openWikipedia(at: indexPath) + + tableView.deselectRow(at: indexPath, animated: true) + } + +} // MARK: - Helpers