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
32 lines
811 B
Swift
32 lines
811 B
Swift
//
|
|
// LocationsListViewModeling.swift
|
|
// Locations
|
|
//
|
|
// Created by Javier Cicchelli on 11/04/2023.
|
|
// Copyright © 2023 Röck+Cöde. All rights reserved.
|
|
//
|
|
|
|
import Combine
|
|
import Foundation
|
|
import Persistence
|
|
|
|
protocol LocationsListViewModeling: AnyObject {
|
|
|
|
// MARK: Properties
|
|
|
|
var coordinator: LocationsListCoordination? { get set }
|
|
|
|
var locationsDidChangePublisher: PassthroughSubject<[Change], Never> { get }
|
|
var numberOfLocationSections: Int { get }
|
|
var viewStatusPublisher: Published<LocationsListViewStatus>.Publisher { get }
|
|
|
|
// MARK: Functions
|
|
|
|
func loadLocations()
|
|
func location(at indexPath: IndexPath) -> Location
|
|
func numberOfLocations(in section: Int) -> Int
|
|
func openLocationsAdd()
|
|
func openWikipedia(at indexPath: IndexPath)
|
|
|
|
}
|