Defined the "openWikipedia(at: )" function in the LocationsListViewModeling protocol and implement it in the LocationsListViewModel view model.
This commit is contained in:
parent
8dd4de175b
commit
ac39e943db
@ -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)
|
||||
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user