iOS/Sources/Shared/Environment/WatchUserDefaults.swift

20 lines
472 B
Swift

import Foundation
public enum WatchUserDefaultsKey: String {
case watchSSID
}
public final class WatchUserDefaults {
public static var shared = WatchUserDefaults()
private let userDefaults = UserDefaults()
public func set(_ value: Any?, key: WatchUserDefaultsKey) {
userDefaults.set(value, forKey: key.rawValue)
}
public func string(for key: WatchUserDefaultsKey) -> String? {
userDefaults.string(forKey: key.rawValue)
}
}