KeychainStore<T: Codable> is a generic class that stores instances of classes that conform to the Codable protocol
let store = KeychainStore<Card>(account: "test")
let card = Card(number: "4111111111111111", name: "Me")
// save card:
try store.set(object: card, forKey: "my card")
// or:
try store.set(object: card, forKey: "my card", accessibility: .whenPasscodeSetThisDeviceOnly)
// get card
let card = try store.object(forKey: "my card")
Additionally, the class KeychainStringStore saves String instances in the Keychain.
KeychainStore
Swift 5 Framework to access the Keychain
Usage
KeychainStore<T: Codable>
is a generic class that stores instances of classes that conform to theCodable
protocolAdditionally, the class
KeychainStringStore
savesString
instances in the Keychain.