Defined the "openWikipediaApp(with: )" function in the LocationsListCoordination protocol and implement it in the LocationsListCoordinator coordinator.

This commit is contained in:
Javier Cicchelli 2023-04-13 00:44:40 +02:00
parent dc7dbfb61a
commit 8dd4de175b
2 changed files with 11 additions and 0 deletions

View File

@ -61,4 +61,12 @@ extension LocationsListCoordinator: LocationsListCoordination {
) )
} }
func openWikipediaApp(with url: URL) {
guard UIApplication.shared.canOpenURL(url) else {
return
}
UIApplication.shared.open(url)
}
} }

View File

@ -6,10 +6,13 @@
// Copyright © 2023 Röck+Cöde. All rights reserved. // Copyright © 2023 Röck+Cöde. All rights reserved.
// //
import Foundation
protocol LocationsListCoordination: AnyObject { protocol LocationsListCoordination: AnyObject {
// MARK: Functions // MARK: Functions
func openLocationsAddScreen() func openLocationsAddScreen()
func openWikipediaApp(with url: URL)
} }