mirror of
https://github.com/metabolist/metatext
synced 2025-01-04 14:02:02 +01:00
20 lines
405 B
Swift
20 lines
405 B
Swift
|
// Copyright © 2020 Metabolist. All rights reserved.
|
||
|
|
||
|
import Foundation
|
||
|
|
||
|
typealias FakeKeychain = [String: Data]
|
||
|
|
||
|
extension FakeKeychain: KeychainType {
|
||
|
mutating func set(data: Data, forKey key: String) throws {
|
||
|
self[key] = data
|
||
|
}
|
||
|
|
||
|
mutating func deleteData(key: String) throws {
|
||
|
self[key] = nil
|
||
|
}
|
||
|
|
||
|
func getData(key: String) throws -> Data? {
|
||
|
self[key]
|
||
|
}
|
||
|
}
|