From 402a4933cac763f63d232a09788d2b1b2dc614af Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Thu, 21 Mar 2024 19:48:51 +0100 Subject: [PATCH] Implemented the AppCoordinator coordinator in the App target. --- App/Sources/Coordinators/AppCoordinator.swift | 40 +++++++++++++++++++ Reviews.xcodeproj/project.pbxproj | 22 +++++++++- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 App/Sources/Coordinators/AppCoordinator.swift diff --git a/App/Sources/Coordinators/AppCoordinator.swift b/App/Sources/Coordinators/AppCoordinator.swift new file mode 100644 index 0000000..ebafe0c --- /dev/null +++ b/App/Sources/Coordinators/AppCoordinator.swift @@ -0,0 +1,40 @@ +// +// AppCoordinator.swift +// App +// +// Created by Javier Cicchelli on 21/03/2024. +// Copyright © 2024 Röck+Cöde. All rights reserved. +// + +import Foundation +import ReviewsCoordinationKit +import ReviewsFeed +import UIKit + +final class AppCoordinator: Coordinator { + + // MARK: Constants + let router: any Router + + // MARK: Properties + var children: [any Coordinator] = [] + + lazy var navigationController = UINavigationController() + + // MARK: Initialisers + init(router: any Router) { + self.router = router + } + + // MARK: Functions + func present( + animated: Bool, + onDismiss: Router.OnDismissClosure? = nil + ) { + router.present( + navigationController, + animated: false + ) + } + +} diff --git a/Reviews.xcodeproj/project.pbxproj b/Reviews.xcodeproj/project.pbxproj index a33fbb5..3e3f750 100644 --- a/Reviews.xcodeproj/project.pbxproj +++ b/Reviews.xcodeproj/project.pbxproj @@ -14,6 +14,7 @@ 02909E7B2BAB6D2E00710E14 /* Bundle+Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02909E7A2BAB6D2E00710E14 /* Bundle+Constants.swift */; }; 02909E7D2BAB7FFE00710E14 /* Review+DTOs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02909E7C2BAB7FFE00710E14 /* Review+DTOs.swift */; }; 02C1B1972BAC9BFE001781DE /* FeedListCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02C1B1962BAC9BFE001781DE /* FeedListCoordinator.swift */; }; + 02C1B1A92BACA722001781DE /* AppCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02C1B1A82BACA722001781DE /* AppCoordinator.swift */; }; 02DA924E2BAAE3FD00C47985 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 02DA924D2BAAE3FD00C47985 /* Localizable.xcstrings */; }; 02DC7F9F2BA51793000EEEBE /* ReviewsFeed.h in Headers */ = {isa = PBXBuildFile; fileRef = 02DC7F912BA51793000EEEBE /* ReviewsFeed.h */; settings = {ATTRIBUTES = (Public, ); }; }; 02DC7FA22BA51793000EEEBE /* ReviewsFeed.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 02DC7F8F2BA51793000EEEBE /* ReviewsFeed.framework */; }; @@ -65,6 +66,7 @@ 02909E7A2BAB6D2E00710E14 /* Bundle+Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle+Constants.swift"; sourceTree = ""; }; 02909E7C2BAB7FFE00710E14 /* Review+DTOs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Review+DTOs.swift"; sourceTree = ""; }; 02C1B1962BAC9BFE001781DE /* FeedListCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedListCoordinator.swift; sourceTree = ""; }; + 02C1B1A82BACA722001781DE /* AppCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppCoordinator.swift; sourceTree = ""; }; 02DA924D2BAAE3FD00C47985 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = ""; }; 02DC7F8F2BA51793000EEEBE /* ReviewsFeed.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ReviewsFeed.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 02DC7F912BA51793000EEEBE /* ReviewsFeed.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReviewsFeed.h; sourceTree = ""; }; @@ -205,6 +207,22 @@ path = Coordinators; sourceTree = ""; }; + 02C1B1A62BACA6FC001781DE /* App */ = { + isa = PBXGroup; + children = ( + 345AD11B24C6EDD9004E2EE1 /* AppDelegate.swift */, + ); + path = App; + sourceTree = ""; + }; + 02C1B1A72BACA70B001781DE /* Coordinators */ = { + isa = PBXGroup; + children = ( + 02C1B1A82BACA722001781DE /* AppCoordinator.swift */, + ); + path = Coordinators; + sourceTree = ""; + }; 02DA924B2BAAE3E500C47985 /* Resources */ = { isa = PBXGroup; children = ( @@ -242,7 +260,8 @@ 02DC7F742BA4F93B000EEEBE /* Sources */ = { isa = PBXGroup; children = ( - 345AD11B24C6EDD9004E2EE1 /* AppDelegate.swift */, + 02C1B1A62BACA6FC001781DE /* App */, + 02C1B1A72BACA70B001781DE /* Coordinators */, ); path = Sources; sourceTree = ""; @@ -469,6 +488,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 02C1B1A92BACA722001781DE /* AppCoordinator.swift in Sources */, 345AD11C24C6EDD9004E2EE1 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0;