From fa6ae4863e60673ed3610101872a74c080ea2f77 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Wed, 12 Apr 2023 21:41:30 +0200 Subject: [PATCH] Implemented the dismissal of the LocationsAddCoordinator coordinator. --- .../Sources/Coordinators/LocationsAddCoordinator.swift | 10 +++++++++- .../Coordination/LocationsAddCoordination.swift | 8 +++++++- .../Screens/LocationsAdd/LocationsAddViewModel.swift | 2 ++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Apps/Locations/Sources/Coordinators/LocationsAddCoordinator.swift b/Apps/Locations/Sources/Coordinators/LocationsAddCoordinator.swift index 61dd9c0..7d8891d 100644 --- a/Apps/Locations/Sources/Coordinators/LocationsAddCoordinator.swift +++ b/Apps/Locations/Sources/Coordinators/LocationsAddCoordinator.swift @@ -38,4 +38,12 @@ class LocationsAddCoordinator: Coordinator { // MARK: - LocationsAddCoordination -extension LocationsAddCoordinator: LocationsAddCoordination {} +extension LocationsAddCoordinator: LocationsAddCoordination { + + // MARK: Functions + + func closeAddLocation() { + router.dismiss(animated: true) + } + +} diff --git a/Apps/Locations/Sources/Protocols/Coordination/LocationsAddCoordination.swift b/Apps/Locations/Sources/Protocols/Coordination/LocationsAddCoordination.swift index 6dd5bee..9819245 100644 --- a/Apps/Locations/Sources/Protocols/Coordination/LocationsAddCoordination.swift +++ b/Apps/Locations/Sources/Protocols/Coordination/LocationsAddCoordination.swift @@ -6,4 +6,10 @@ // Copyright © 2023 Röck+Cöde. All rights reserved. // -protocol LocationsAddCoordination: AnyObject {} +protocol LocationsAddCoordination: AnyObject { + + // MARK: Functions + + func closeAddLocation() + +} diff --git a/Apps/Locations/Sources/Screens/LocationsAdd/LocationsAddViewModel.swift b/Apps/Locations/Sources/Screens/LocationsAdd/LocationsAddViewModel.swift index def74b0..b447c1c 100644 --- a/Apps/Locations/Sources/Screens/LocationsAdd/LocationsAddViewModel.swift +++ b/Apps/Locations/Sources/Screens/LocationsAdd/LocationsAddViewModel.swift @@ -53,6 +53,8 @@ extension LocationsAddViewModel: LocationsAddViewModeling { latitude: location.latitude, longitude: location.longitude ) + + coordinator?.closeAddLocation() } func setLocation(latitude: Float, longitude: Float) {