diff --git a/Sources/RefdsShared/Data/RefdsDefaults.swift b/Sources/RefdsShared/Data/RefdsDefaults.swift index 9457f0d..6d6a0cf 100644 --- a/Sources/RefdsShared/Data/RefdsDefaults.swift +++ b/Sources/RefdsShared/Data/RefdsDefaults.swift @@ -5,6 +5,14 @@ public struct RefdsDefaults { let key: String var defaultValue: Value? = nil + public init( + key: String, + defaultValue: Value? = nil + ) { + self.key = key + self.defaultValue = defaultValue + } + public var wrappedValue: Value? { get { Self.defaults.object(forKey: key) as? Value } set { Self.defaults.set(newValue, forKey: key) }