This PR contains the work done to open the *Places* view of the **Wikipedia** app with the screen centered on the coordinates from a selected location in the `LocationsListViewController` view controller. To give further details about the work done: - [x] implemented the `wikipediaPlacesURL` property in the `Location+URLs` extension; - [x] improved the `LocationsListCoordination` protocol and the `LocationsListCoordinator` coordinator to support the opening of the Wikipedia app; - [x] improved the `LocationsListViewModeling` protocol and the `LocationsListViewModel` view model to support the opening of the Wikipedia app; - [x] implemented the "tableView(_: didSelectAt: )" function in the `LocationsListViewController` view controller; - [x] added the "wikipedia" to the Queried URL schemes in the Info.plist file to support querying to the Wikipedia app; - [x] improved the naming of some properties and functions in the `LocationsAddCoordination`, `LocationsListCoordination`, and `LocationsListViewModeling` protocols. Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Reviewed-on: rock-n-code/deep-linking-assignment#12
50 lines
977 B
Swift
50 lines
977 B
Swift
//
|
|
// LocationsAddCoordinator.swift
|
|
// Locations
|
|
//
|
|
// Created by Javier Cicchelli on 11/04/2023.
|
|
// Copyright © 2023 Röck+Cöde. All rights reserved.
|
|
//
|
|
|
|
import Core
|
|
import UIKit
|
|
|
|
class LocationsAddCoordinator: Coordinator {
|
|
|
|
// MARK: Properties
|
|
|
|
var children: [Coordinator] = []
|
|
var router: Router
|
|
|
|
// MARK: Initialisers
|
|
|
|
init(router: Router) {
|
|
self.router = router
|
|
}
|
|
|
|
// MARK: Coordinator
|
|
|
|
func present(animated: Bool, onDismiss: (() -> Void)?) {
|
|
router.present(
|
|
LocationsAddViewController(
|
|
viewModel: LocationsAddViewModel(coordinator: self)
|
|
),
|
|
animated: animated,
|
|
onDismiss: onDismiss
|
|
)
|
|
}
|
|
|
|
}
|
|
|
|
// MARK: - LocationsAddCoordination
|
|
|
|
extension LocationsAddCoordinator: LocationsAddCoordination {
|
|
|
|
// MARK: Functions
|
|
|
|
func closeLocationsAddScreen() {
|
|
router.dismiss(animated: true)
|
|
}
|
|
|
|
}
|