[Feature] Open Wikipedia app #12

Merged
javier merged 6 commits from feature/open-wikipedia-app into main 2023-04-12 23:07:43 +00:00
2 changed files with 7 additions and 0 deletions
Showing only changes of commit ac39e943db - Show all commits

View File

@ -26,5 +26,6 @@ protocol LocationsListViewModeling: AnyObject {
func location(at indexPath: IndexPath) -> Location func location(at indexPath: IndexPath) -> Location
func numberOfLocations(in section: Int) -> Int func numberOfLocations(in section: Int) -> Int
func openLocationsAdd() func openLocationsAdd()
func openWikipedia(at indexPath: IndexPath)
} }

View File

@ -76,6 +76,12 @@ extension LocationsListViewModel: LocationsListViewModeling {
coordinator?.openLocationsAddScreen() coordinator?.openLocationsAddScreen()
} }
func openWikipedia(at indexPath: IndexPath) {
guard let url = locationProvider.location(at: indexPath).wikipediaPlacesURL else {
return
}
coordinator?.openWikipediaApp(with: url)
} }
} }