Classes
The following classes are available globally.
-
See moreKeychainStorage
is a generic class that conforms to theStorageDelegate
protocol, providing a secure storage solution by leveraging the keychain. It is designed to store, retrieve, and manage objects of typeT
, whereT
must conform to theCodable
protocol. This requirement ensures that the objects can be easily encoded and decoded for secure storage in the keychain.Declaration
Swift
public class KeychainStorage<T> : StorageDelegate<T>, @unchecked Sendable where T : Decodable, T : Encodable, T : Sendable
Parameters
T
The type of the objects to be stored in the keychain. Must conform to
Codable
. -
MemoryStorage
provides an in-memory storage solution for objects of typeT
. It conforms to theStorageDelegate
protocol, enabling it to interact seamlessly with other components expecting a storage delegate. This class is ideal for temporary storage where persistence across app launches is not required.The generic type
See moreT
must conform toCodable
to ensure that objects can be encoded and decoded when written to and read from memory, respectively.Declaration
Swift
public class MemoryStorage<T> : StorageDelegate<T>, @unchecked Sendable where T : Decodable, T : Encodable, T : Sendable
Parameters
T
The type of the objects to be stored. Must conform to
Codable
. -
A storage delegate class that delegates its operations to a storage. It can optionally cache the stored item in memory. This class is designed to be subclassed by specific storage strategies (e.g., keychain, in-memory) that conform to the
See moreStorage
protocol.Declaration
Swift
open class StorageDelegate<T> : Storage, @unchecked Sendable where T : Decodable, T : Encodable, T : Sendable
Parameters
T
The type of the object being stored. Must conform to
Codable
to ensure that object can be easily encoded and decoded.