Classes

The following classes are available globally.

  • KeychainStorage is a generic class that conforms to the StorageDelegate protocol, providing a secure storage solution by leveraging the keychain. It is designed to store, retrieve, and manage objects of type T, where T must conform to the Codable protocol. This requirement ensures that the objects can be easily encoded and decoded for secure storage in the keychain.

    See more

    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 type T. It conforms to the StorageDelegate 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 T must conform to Codable to ensure that objects can be encoded and decoded when written to and read from memory, respectively.

    See more

    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 Storage protocol.

    See more

    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.