diff --git a/Apps/Locations/Sources/Protocols/ViewModeling/LocationsListViewModeling.swift b/Apps/Locations/Sources/Protocols/ViewModeling/LocationsListViewModeling.swift index 324278d..4073b1c 100644 --- a/Apps/Locations/Sources/Protocols/ViewModeling/LocationsListViewModeling.swift +++ b/Apps/Locations/Sources/Protocols/ViewModeling/LocationsListViewModeling.swift @@ -26,5 +26,6 @@ protocol LocationsListViewModeling: AnyObject { func location(at indexPath: IndexPath) -> Location func numberOfLocations(in section: Int) -> Int func openLocationsAdd() + func openWikipedia(at indexPath: IndexPath) } diff --git a/Apps/Locations/Sources/Screens/LocationsList/LocationsListViewModel.swift b/Apps/Locations/Sources/Screens/LocationsList/LocationsListViewModel.swift index 8413775..dedcbdc 100644 --- a/Apps/Locations/Sources/Screens/LocationsList/LocationsListViewModel.swift +++ b/Apps/Locations/Sources/Screens/LocationsList/LocationsListViewModel.swift @@ -76,6 +76,12 @@ extension LocationsListViewModel: LocationsListViewModeling { coordinator?.openLocationsAddScreen() } + func openWikipedia(at indexPath: IndexPath) { + guard let url = locationProvider.location(at: indexPath).wikipediaPlacesURL else { + return + } + + coordinator?.openWikipediaApp(with: url) } }