From daf8bd7ff643638d95f216095f7cb07206f5a30d Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Tue, 11 Apr 2023 15:03:39 +0200 Subject: [PATCH] Defined the View and the ViewModel protocols. --- .../Libraries/Sources/Core/Protocols/View.swift | 17 +++++++++++++++++ .../Sources/Core/Protocols/ViewModel.swift | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 Apps/Locations/Libraries/Sources/Core/Protocols/View.swift create mode 100644 Apps/Locations/Libraries/Sources/Core/Protocols/ViewModel.swift diff --git a/Apps/Locations/Libraries/Sources/Core/Protocols/View.swift b/Apps/Locations/Libraries/Sources/Core/Protocols/View.swift new file mode 100644 index 0000000..43c0b70 --- /dev/null +++ b/Apps/Locations/Libraries/Sources/Core/Protocols/View.swift @@ -0,0 +1,17 @@ +// +// View.swift +// Core +// +// Created by Javier Cicchelli on 11/04/2023. +// Copyright © 2023 Röck+Cöde. All rights reserved. +// + +/// This protocol defines the view of the **MVVM** architecture. +public protocol View { + + // MARK: Properties + + /// The view model related to the view. + var viewModel: ViewModel { get set } + +} diff --git a/Apps/Locations/Libraries/Sources/Core/Protocols/ViewModel.swift b/Apps/Locations/Libraries/Sources/Core/Protocols/ViewModel.swift new file mode 100644 index 0000000..a550329 --- /dev/null +++ b/Apps/Locations/Libraries/Sources/Core/Protocols/ViewModel.swift @@ -0,0 +1,17 @@ +// +// ViewModel.swift +// Core +// +// Created by Javier Cicchelli on 11/04/2023. +// Copyright © 2023 Röck+Cöde. All rights reserved. +// + +/// This protocol defines the view model of the **MVVM** architecture. +public protocol ViewModel: AnyObject { + + // MARK: Properties + + /// The reference to the coordinator that initialised the view model. + var coordinator: Coordinator { get set } + +}