forked from alexruperez/SecurePropertyStorage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Storage.swift
24 lines (22 loc) · 997 Bytes
/
Storage.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import Foundation
public typealias StoreKey = String
public protocol Storage: StorageDelegate {
func register(defaults registration: [StoreKey: Any])
func value<V>(forKey key: StoreKey) -> V?
func string(forKey key: StoreKey) -> String?
func array(forKey key: StoreKey) -> [Any]?
func dictionary(forKey key: StoreKey) -> [String: Any]?
func stringArray(forKey key: StoreKey) -> [String]?
func integer(forKey key: StoreKey) -> Int
func float(forKey key: StoreKey) -> Float
func double(forKey key: StoreKey) -> Double
func bool(forKey key: StoreKey) -> Bool
func url(forKey key: StoreKey) -> URL?
func set(_ value: Int, forKey key: StoreKey)
func set(_ value: Float, forKey key: StoreKey)
func set(_ value: Double, forKey key: StoreKey)
func set(_ value: Bool, forKey key: StoreKey)
func set(_ url: URL?, forKey key: StoreKey)
func set(_ string: String, forKey key: StoreKey)
func set<V>(_ value: V?, forKey key: StoreKey)
}