From a6fddfabc1800900d8797aea9d46a4581d8c02b0 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Tue, 11 Apr 2023 02:01:12 +0200 Subject: [PATCH] Defined the DependencyKey protocol. --- .../Dependency/Protocols/DependencyKey.swift | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Apps/Locations/Libraries/Sources/Dependency/Protocols/DependencyKey.swift diff --git a/Apps/Locations/Libraries/Sources/Dependency/Protocols/DependencyKey.swift b/Apps/Locations/Libraries/Sources/Dependency/Protocols/DependencyKey.swift new file mode 100644 index 0000000..8f5fb08 --- /dev/null +++ b/Apps/Locations/Libraries/Sources/Dependency/Protocols/DependencyKey.swift @@ -0,0 +1,22 @@ +// +// DependencyKey.swift +// Dependency +// +// Created by Javier Cicchelli on 11/04/2023. +// Copyright © 2023 Röck+Cöde. All rights reserved. +// + +/// This protocol defines a key to use in the dependency service. +public protocol DependencyKey { + + // MARK: Associated types + + /// The associated type representing the type of the dependency key's value. + associatedtype Value + + // MARK: Properties + + /// The default value for the dependency key. + static var currentValue: Value { get set } + +}